2

I have a machine running Fedora acting as a LAN/WAN gateway that runs dnsmasq as a DHCP server for the LAN. This works great for the clients, but the gatway machine itself is unable to resolve names of machines on the LAN.

The trouble is that NetworkManager insists on configuring resolf.conf to use the WAN DNS first. If I use nslookup to force use of localhost (127.0.0.1) as the DNS server, I can resolve names of machines on the LAN just fine.

I've tried setting dns=dnsmasq and fiddling with ipv4.dns-priority to no avail; NM still makes the WAN DNS servers¹ first. How do I make NM use localhost (127.0.0.1) as the first DNS server?

(¹ I'm not sure if it matters, but apparently I am getting an IPv6 DNS server frpm the WAN connection. Also if it matters, the "WAN" is actually a LinkSys router.)

Edit:

It turns out dns=dnsmasq is no good; NM won't start it if the "real" dnsmasq is running (almost certainly because it can't bind to the in-use ports), and NM's version doesn't seem to want to supply DHCP (at least, if I copy the DHCP server config from /etc/dnsmasq.d to /etc/NetworkManager/dnsmasq.d, NM's dnsmasq quits coming up.) So it seems I really, really need to force the local system to prefer the LAN DNS servers over the WAN DNS servers. Which... should be ipvx.dns-priority IIUC, except fiddling with those does not seem to have any effect 😢.

0

You must log in to answer this question.

Browse other questions tagged .