Optional migration from Turris OS 3.x for advanced users

After reading through /etc/init.d/dnsmasq, I did find a solution to ensuring my LAN’s DNS server is in /etc/resolv.conf:

# Set an interface's DNS server (can be lan, wan, wan6 etc)
uci add_list network.lan.dns=192.168.1.253

# Restores /tmp/resolv.conf to a symlink to /tmp/resolv.conf.auto
/etc/init.d/dnsmasq stop
# Prevent dnsmasq replacing /tmp/resolv.conf again
uci add_list dhcp.@dnsmasq[-1].localuse=0
uci commit
/etc/init.d/dnsmasq start

The result is that /etc/resolv.conf symlinks to /tmp/resolv.conf which links to /tmp/resolv.conf.auto which is generated from the network interface custom DNS server(s) compared to the previous setup where dnsmasq was writing its own /tmp/resolv.conf to use localhost as its sole resolver.

1 Like