What's new
  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

resolv.conf bug?

rhester72

Occasional Visitor
Firmware version 3.0.0.4.376.47_0 on a RT-N66U

For local (i.e. on the router itself) name resolution in a standard dnsmasq setup, /etc/resolv.conf should _always_ be populated with 127.0.0.1. When setting "Connect to DNS Server automatically" to No (I'm using unbound locally), any entries in the DNS Server boxes appear in resolv.conf (should they? Seems they'd belong in /tmp/resolv.dnsmasq instead, just like the IPv6 nameservers, since they have nothing to do with _local_ resolution), but no 127.0.0.1, which means the router itself can't resolve local hostnames (as defined by DHCP, etc.).

I was unable to find any custom config override for resolv.conf, and confirmed that the "rom copy" of /etc/resolv.conf contains the correct entry (not that it's used at all, but...).

Is this "normal" and I'm just missing something very obvious, or is something broken? (I can't even override it by trying to force 127.0.0.1 as a DNS Server through the GUI, because it tells me that's not a valid entry.)

Rodney
 
Firmware version 3.0.0.4.376.47_0 on a RT-N66U

For local (i.e. on the router itself) name resolution in a standard dnsmasq setup, /etc/resolv.conf should _always_ be populated with 127.0.0.1. When setting "Connect to DNS Server automatically" to No (I'm using unbound locally), any entries in the DNS Server boxes appear in resolv.conf (should they? Seems they'd belong in /tmp/resolv.dnsmasq instead, just like the IPv6 nameservers, since they have nothing to do with _local_ resolution), but no 127.0.0.1, which means the router itself can't resolve local hostnames (as defined by DHCP, etc.).

I was unable to find any custom config override for resolv.conf, and confirmed that the "rom copy" of /etc/resolv.conf contains the correct entry (not that it's used at all, but...).

Is this "normal" and I'm just missing something very obvious, or is something broken? (I can't even override it by trying to force 127.0.0.1 as a DNS Server through the GUI, because it tells me that's not a valid entry.)

Rodney

This was already changed in 376.48 beta, a few weeks ago:

https://github.com/RMerl/asuswrt-merlin/commit/6778f5f4932130421befc212c0bcf1ef0c0deede
 
Thanks!

Since upstream IPv4 servers appear to have previously been stored in resolv.conf (and thus picked up by dnsmasq), were those "relocated" as well?

Rodney
 
Thanks!

Since upstream IPv4 servers appear to have previously been stored in resolv.conf (and thus picked up by dnsmasq), were those "relocated" as well?

Rodney

Asuswrt uses two separate resolv.conf files. One is for the Linux environment, and the other is for dnsmasq's own usage.
 
I suppose that's where my confusion is coming from.

On current stable, this is what I'm seeing in AsusWRT Merlin having defined Google public DNS servers as the "WAN DNS" servers in the GUI:

Code:
admin@cerberus:/tmp/home/root# cat /etc/resolv.conf
nameserver 8.8.8.8
nameserver 8.8.4.4

derived from these NVRAM vars:

Code:
admin@cerberus:/tmp/home/root# nvram show 2>&1 | grep wan_dns[0-9] | grep -v ^size:
wan_dns2_x=8.8.4.4
wan_dns1_x=8.8.8.8

I'd expect to see them in the "dnsmasq-specific" file, not resolv.conf in /etc.

Rodney
 
Last edited:
The fix he referenced was about 127.0.0.1 not appearing in /etc/resolv.conf, and from the diff, it is indeed fixed. That's why I asked the second question, because unless there was another fix, that means that /etc/resolv.conf now contains 127.0.0.1 *and* the IPv4 DNS servers, when it should not. (Practically, owing to how the Linux resolver works, it makes no difference, to be fair.)

I'd upgrade to beta 2 and look myself, but right now, there's still a bit too much churn for me to be able to do that on my primary router if I do not wish to be hunted down with pitchforks by my family. *laughs*

Rodney
 
I understand about not upgrading to the beta, I'm of the same opinion. :)

My reading of the diff is that it has reverted back to the previous behaviour. i.e. /etc/resolv.conf is a symbolic link to /rom/etc/resolv.conf. Here's the output from my 374.43
Code:
# ls -l /etc/resolv.conf
lrwxrwxrwx    1 admin    root            20 Nov  1 01:19 /etc/resolv.conf -> /rom/etc/resolv.conf
# cat /etc/resolv.conf
nameserver 127.0.0.1
# cat /tmp/resolv.conf
nameserver 208.67.222.222
nameserver 208.67.220.220
/tmp/resolv.conf is referenced in /etc/dnsmasq.conf
 
Last edited:

Similar threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Back
Top