kristrev / multi

MULTI is a command line network manager for Linux with multihoming support.
GNU General Public License v3.0
40 stars 16 forks source link

Support for settings nameserver from dhcp? #1

Open fadenb opened 10 years ago

fadenb commented 10 years ago

Hi,

I would love to see multi with the ability to configure nameservers provided dhcp.

I started toying around with multi in combination with mptcp and really like it. The only thing that is missing in order to completely replace my old setup is the ability to set nameservers provided by the dhcp servers.

kristrev commented 10 years ago

Hi,

Good idea, I will try to look into it over weekend. The information should already be there, so the biggest challenge is to ensure that resolv.conf mirrors the interface metrics. DNS requests are sent to the first DNS server on the list, but if there are overlapping networks then the request might not be sent over the correct interface. Some DNS servers block requests from clients not belonging to their network.

One easy solution would be to just have resolv.conf contain the nameservers of the interface with the lowest metric, and then update the entire file as needed.

kristrev commented 10 years ago

Hi Faden,

Sorry for taking so long on this. Work has gotten in the way and I have not been able to look more into adding this feature. I will try to get it ready as soon as possible. Btw, I saw that you had forked multi, are you working on adding support for DNS?

fadenb commented 10 years ago

Hey, no rush :)

I forked it to work on creating a Debian package for multi. But as it goes I did not have time to do some real work myself. I will let you know when it is it packaged.

ybastide commented 10 years ago

Hi,

Instead of changing resolv.conf, it may be better to use either resolvconf(8) or systemd-networkd(8). I can take a stab at a resolvconf-based solution, but I'm not sure how, where, in which state machine it's best to implement up/down...

kristrev commented 10 years ago

Sorry for my very late reply, I have been and still am on holiday :)

My suggestion would be to that when an interface becomes available/unavailable (so in multi_multicast), recreate the entire resolv.conf by iterating through interfaces and adding the DNS addresses acquired through DHCP. You should add public DNS servers (for example Google and OpenDNS) to the end of the file, for interfaces that are not configured through DHCP (or if a DNS server fails).