resolvfile option in /etc/config/dhcp being ignored?
I'm having some trouble resolving local addresses and wondering if I'm missing something.
I can resolve things from external DNS just fine, so I know it's not a general resolver issue, but I can't resolve anything on my local network from the Omega. I see that the proper settings are getting picked up via DHCP and written to /tmp/resolv.conf.auto. And in fact, if I copy those settings into /tmp/resolv.conf, everything resolves.
Looking at the openwrt docs it seems like this should work, as long as the proper resolvfile is set in /etc/config/dhcp. I checked and it's set up right, but doesn't seem to be taking effect.
Anybody know how to get local DNS to work without tweaking /tmp/resolv.conf manually?
root@myonion:/etc/config# cat /tmp/resolv.conf search lan nameserver 127.0.0.1 root@myonion:/etc/config# cat /tmp/resolv.conf.auto # Interface wwan nameserver 10.1.10.1 search mydomain root@myonion:/etc/config# ping -c 1 google.com PING google.com (18.104.22.168): 56 data bytes 64 bytes from 22.214.171.124: seq=0 ttl=61 time=76.807 ms --- google.com ping statistics --- 1 packets transmitted, 1 packets received, 0% packet loss round-trip min/avg/max = 76.807/76.807/76.807 ms root@myonion:/etc/config# ping -c 1 goodaddress.mydomain ping: bad address 'goodaddress.mydomain' root@projector:/etc/config# cp /tmp/resolv.conf.auto /tmp/resolv.conf root@myonion:/etc/config# ping -c 1 goodaddress.mydomain PING goodaddress.mydomain (10.0.0.135): 56 data bytes 64 bytes from 10.0.0.135: seq=0 ttl=64 time=5.364 ms --- goodaddress.mydomain ping statistics --- 1 packets transmitted, 1 packets received, 0% packet loss round-trip min/avg/max = 5.364/5.364/5.364 ms root@myonion:/etc/config# grep resolvfile dhcp option resolvfile '/tmp/resolv.conf.auto'
Hi @fader, sorry for the late reply. Have you tried adding the routes to
/etc/hosts? Or are you trying to defining the DNS records at your router level, and want to get the Omega to check the DNS from the router?
@Boken-Lin Yeah, what I'd ideally like is for the Omega to pick up my router as the primary DNS server. Since the router automatically adds an entry for anything it gives a DHCP address to, it saves me from ever having to go back and touch /etc/hosts on devices when I add something new to my network.
What confuses me is that the config files are getting properly written, but they don't seem to be used. If I just copy over the (auto-generated) /tmp/resolv.conf.auto to /tmp/resolv.conf, it picks up DNS from my router just fine. And per the openwrt docs, the (auto-generated) entry for /tmp/resolv.conf.auto should be added along with /tmp/resolv.conf by the settings that are already in /etc/config/dhcp.
So I'm pretty sure there's a bug somewhere, whether it's openwrt or the generated config (or somewhere else) but I'm just not sure where to dig past this.
Stephen Tunney last edited by
I too am running into this issue with the latest firmware (Ando) and all packages updated as of 2016/08/23.
My .auto file is correct but not respected. When I overwrite the .conf with the contents of .auto
- cp /tmp/resolv.conf.auto /tmp/resolv.conf
my hostname resolution starts working immediately. This is definitely a bug somewhere in the system.
From reading on dnsmasq here: https://wiki.openwrt.org/doc/howto/dhcp.dnsmasq
And I found a bug in dnsmasq that looks VERY close to what we are talking about here:
Not sure if this is it since it is quite old (7+ years) but maybe someone has some insights?