BerlinVagrant / vagrant-dns

A plugin to manage DNS records for vagrant environments

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Linux support (?)

skade opened this issue · comments

There is an explanation by @heftig on how to add additional name services in Linux.

codemancers/invoker#22 (comment)

I am not sure whether I like the solution, though. It involves registering a complete new name service with libc, which - in contrast to the OS X variant - potentially impacts the whole system.

I think it would be better to run the service on port 53 but on a completely different address in the 127.x.x.x/8 range as advised in systemd/systemd#4377

That would then be applicable for all OS's?

Altering /etc/resolver/ on OS X also impacts the whole system. It's really not that different in scope.

A difference is that now your code is getting loaded by the entire system (instead of just your configuration affecting the whole system). If you're concerned about this, you could depend on an existing NSS module like https://github.com/azukiapp/libnss-resolver. The latter implements OS X's scheme on Linux.

The linked bug also mentions dnsmasq which is a poor solution IMO because its impact on system configuration is much greater: Whatever network management the system has must deliver DNS configuration to dnsmasq instead of writing /etc/resolv.conf, which has to be pointed to dnsmasq and dnsmasq only. dnsmasq now proxies all DNS requests.

NSS is designed to be extensible, resolv.conf isn't.

vagrant-dns deliberately choose not not listen on port 53 since this would require "sudo" for starting the service (which happens all the time when starting or stopping a box). Other systems than macOS might have a sophisticated way of granting this specific right to a user

systemd-resolved supports setting custom ports for dns servers since a while.

I made a proof-of-concept for Linux support here.

Got stuck because setting static IP's is a rootful operation with libvirt (I'm using vagrant-libvirt) so I'd need #37 to be fixed as well.

Nice! We still have #51 open, which IIRC needed some trigger feature from Vagrant. I'd need to look into that - it's been a while.

However, would you mind opening a PR?

@fnordfish absolutely, I just need to get this all working first. I've been struggling trying to get static IPs working with vagrant-libvirt to the point where I managed to break stuff. Once I've confirmed that stuff actually works (and aside from Fedora also Ubuntu) I'll come back to this!

Forgot to link back here. But there's a PR since a while: #75 . If anyone could test that it works on Linux that would be great. Especially on other distributions than Fedora and with other providers than libvirt.

I think this one can be closed?

Closing this one for now. With v2.30, we can now hook into systemd (systemd-resolved), which obviously is not Linux. If anyone likes to see support for a non systemd Linux, please open a new issue. Ideally with an implementation suggestion :)