Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFE] resolved: add support for looking up arbitrary RRs in locally defined zone files #11976

Closed
nefethael opened this issue Mar 12, 2019 · 5 comments
Labels
duplicate resolve RFE 🎁 Request for Enhancement, i.e. a feature request

Comments

@nefethael
Copy link

Hi,

Is your feature request related to a problem? Please describe.
In embedded system built by Yocto, I'm trying to ease provisioning by limiting specific configuration. In that context, I wish I could access to "some-remote-device" everywhere, instead of real hostname, then I would like to set it only once.

Describe the solution you'd like
Would it be possible for systemd-resolved to create local cname entry?

Describe alternatives you've considered
I know aliasing is possible with /etc/hosts but only by providing static IP, so if the real hostname device uses DHCP, it will fail.
I could also add dnsmasq, but in my case, I use netplan systemd generator for DNS, so it will break too.

Best regards,
Vincent

@poettering poettering added RFE 🎁 Request for Enhancement, i.e. a feature request resolve labels Mar 13, 2019
@gdamjan
Copy link
Contributor

gdamjan commented Oct 20, 2020

Can we outline a plan for this feature, and I might try implementing it.

Would a list of sub-commands like resolvectl dns-alias add/del/list be sufficient?

something like resolvectl dns-alias add my-alias.example.net 1.1.1.1/www.example.net?

@nefethael
Copy link
Author

@gdamjan Hi,

Maybe adding [Alias] section in /etc/systemd/resolved.conf file with something like:

[Alias]
Host1=192.168.1.1
Host2=.... 

Thanks for your effort,

Best regards,
Vincent

@poettering
Copy link
Member

I think such explicit support for aliases is a bit too explicit for my taste. I think a more generic approach might be better: let's maybe define a dir where people can drop in DNS zone-file-like files that we read and whose contents we honour preferably over whatever DNS might actually resolve things to. i.e. a bit like /etc/hosts, but for more than A/AAAA. Let's say /etc/systemd/rr/*.rr or so, which we parse line by line, and that takes precedence over everything else. Adding an alias would then be a matter of:

echo "foo.bar. IN CNAME quux." > /etc/systemd/rr/30-myalias.rr

You get the idea.

Of course, the usual overriding logic should apply.

@andrevmatos
Copy link

A case where this would be very useful is with containers; with DNSStubListenerExtra, it's already quite feasible to have host's resolved instance serving DNS requests also on veth/local interfaces, and having a way (maybe either/both on /etc and /run) to drop aliases files, would make it easy to make e.g. podman set container's aliases which could work both for host and other containers (in case they're allowed to communicate with them, of course, by firewall).

@poettering poettering changed the title [RFE] systemd-resolved cname alias [RFE] resolved: add support for looking up arbitrary RRs in locally defined zone files Mar 1, 2024
@poettering
Copy link
Member

Actually, this is a duplicate of #17791

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate resolve RFE 🎁 Request for Enhancement, i.e. a feature request
Development

No branches or pull requests

4 participants