DNS name resolution does not work after installation

What's the output of
uci show dhcp.@dnsmasq[]

is that relevant, this is a on router issue, not client ?

# uci show dhcp.@dnsmasq[]
dhcp.cfg01411c=dnsmasq
dhcp.cfg01411c.domainneeded='1'
dhcp.cfg01411c.localise_queries='1'
dhcp.cfg01411c.rebind_protection='1'
dhcp.cfg01411c.rebind_localhost='1'
dhcp.cfg01411c.local='/lan/'
dhcp.cfg01411c.domain='lan'
dhcp.cfg01411c.expandhosts='1'
dhcp.cfg01411c.authoritative='1'
dhcp.cfg01411c.readethers='1'
dhcp.cfg01411c.leasefile='/tmp/dhcp.leases'
dhcp.cfg01411c.resolvfile='/tmp/resolv.conf.d/resolv.conf.auto'
dhcp.cfg01411c.localservice='1'
dhcp.cfg01411c.ednspacket_max='1232'

Yes, that only affects the router. It is also required for the NTP time server. And for the updates of course.
opkg update
fails in this case.

is your /etc/resolv.conf a softlink ?
I still use 19.07, might be different in 21.02.

lrwxrwxrwx 1 root root 16 Jan 19 2021 resolv.conf -> /tmp/resolv.conf

I assume pinging (for instance 8.8.8.8) works, but name resolution fails ?

It's the same like 19.07, it's a link
lrwxrwxrwx 1 root root 16 Sep 1 00:20 /etc/resolv.conf -> /tmp/resolv.conf
The pings over IP addresses runs well, only the name resolution fails on the router.

Well, that looks fine - if you run

netstat -pant | grep "dnsmasq"

can you see dnsmasq listening to 127.0.0.1 and ::1?

1 Like

What does network.wan look like in your device, compared to Setting DNS on my PPPoE WAN - #3 by ajaffarali? ?

No, that's not the case.

Well, there's your problem - of course, I have no idea why dnsmasq would not be listening on localhost

1 Like
network.loopback=interface
network.loopback.device='lo'
network.loopback.proto='static'
network.loopback.ipaddr='127.0.0.1'
network.loopback.netmask='255.0.0.0'
network.globals=globals
network.globals.ula_prefix='fd49:8bd1:464e::/48'
network.@device[0]=device
network.@device[0].name='br-lan'
network.@device[0].type='bridge'
network.@device[0].ports='lan1' 'lan2' 'lan3' 'lan4'
network.@bridge-vlan[0]=bridge-vlan
network.@bridge-vlan[0].device='br-lan'
network.@bridge-vlan[0].vlan='1'
network.@bridge-vlan[0].ports='lan1' 'lan2'
network.@bridge-vlan[1]=bridge-vlan
network.@bridge-vlan[1].device='br-lan'
network.@bridge-vlan[1].vlan='2'
network.@bridge-vlan[1].ports='lan3' 'lan4'
network.office=interface
network.office.device='br-lan.1'
network.office.proto='static'
network.office.netmask='255.255.255.0'
network.office.ip6assign='60'
network.office.ipaddr='192.168.0.1'
network.office.dns='217.237.151.161' '8.8.8.8' '8.8.4.4'
network.home=interface
network.home.device='br-lan.2'
network.home.proto='static'
network.home.ipaddr='192.168.1.1'
network.home.netmask='255.255.255.0'
network.home.ip6assign='60'
network.@device[1]=device
network.@device[1].name='wan'
network.@device[1].macaddr='c6:41:1e:33:b4:3b'
network.wan=interface
network.wan.device='wan'
network.wan.type='bridge'
network.wan.proto='pppoe'
network.wan.username='xxxxxxxxxxxxx'
network.wan.password='xxxxxxxxx'
network.wan.ipv6='auto'
network.wan.peerdns='0'
network.wan.dns='8.8.8.8' '8.8.4.4' '217.237.151.161'
network.wan6=interface
network.wan6.device='wan'
network.wan6.proto='dhcpv6'
network.wan6.type='bridge'
network.wan6.peerdns='0'
network.wan6.dns='2001:4860:4860::8888' '2001:4860:4860::8844'
dhcp.@dnsmasq[0]=dnsmasq
dhcp.@dnsmasq[0].domainneeded='1'
dhcp.@dnsmasq[0].localise_queries='1'
dhcp.@dnsmasq[0].rebind_protection='1'
dhcp.@dnsmasq[0].rebind_localhost='1'
dhcp.@dnsmasq[0].local='/lan/'
dhcp.@dnsmasq[0].domain='lan'
dhcp.@dnsmasq[0].expandhosts='1'
dhcp.@dnsmasq[0].authoritative='1'
dhcp.@dnsmasq[0].readethers='1'
dhcp.@dnsmasq[0].leasefile='/tmp/dhcp.leases'
dhcp.@dnsmasq[0].resolvfile='/tmp/resolv.conf.d/resolv.conf.auto'
dhcp.@dnsmasq[0].localservice='1'
dhcp.@dnsmasq[0].ednspacket_max='1232'
dhcp.@dnsmasq[0].nonwildcard='0'
dhcp.lan=dhcp
dhcp.lan.interface='lan'
dhcp.lan.start='100'
dhcp.lan.limit='150'
dhcp.lan.leasetime='12h'
dhcp.lan.dhcpv4='server'
dhcp.lan.dhcpv6='server'
dhcp.lan.ra='server'
dhcp.lan.ra_slaac='1'
dhcp.lan.ra_flags='managed-config' 'other-config'
dhcp.wan=dhcp
dhcp.wan.interface='wan'
dhcp.wan.ignore='1'
dhcp.wan.ra_flags='none'
dhcp.odhcpd=odhcpd
dhcp.odhcpd.maindhcp='0'
dhcp.odhcpd.leasefile='/tmp/hosts/odhcpd'
dhcp.odhcpd.leasetrigger='/usr/sbin/odhcpd-update'
dhcp.odhcpd.loglevel='4'
dhcp.office=dhcp
dhcp.office.interface='office'
dhcp.office.start='100'
dhcp.office.limit='150'
dhcp.office.leasetime='12h'
dhcp.office.dhcp_option='192.168.0.1' '217.237.151.161' '8.8.8.8' '8.8.4.4' '1.1.1.1'
dhcp.office.ra='server'
dhcp.office.dhcpv6='server'
dhcp.office.dns='2606:4700:4700::1111' '2001:4860:4860::8888'
dhcp.office.ra_flags='none'
dhcp.home=dhcp
dhcp.home.interface='home'
dhcp.home.start='100'
dhcp.home.limit='150'
dhcp.home.leasetime='12h'
dhcp.home.dhcp_option='192.168.0.1' '217.237.151.161' '8.8.8.8' '8.8.4.4' '1.1.1.1'
dhcp.home.ra='server'
dhcp.home.dhcpv6='server'
dhcp.home.dns='2606:4700:4700::1111' '2001:4860:4860::8888'
dhcp.home.ra_flags='none'
lrwxrwxrwx    1 root     root            16 Sep  1 00:20 /etc/resolv.conf -> /tmp/resolv.conf
-rw-r--r--    1 root     root            47 Oct  6 10:40 /tmp/resolv.conf
-rw-r--r--    1 root     root            48 Oct  6 10:18 /tmp/resolv.conf.ppp

/tmp/resolv.conf.d:
-rw-r--r--    1 root     root           183 Oct  6 10:18 resolv.conf.auto
==> /etc/resolv.conf <==
search lan
nameserver 127.0.0.1
nameserver ::1

==> /tmp/resolv.conf <==
search lan
nameserver 127.0.0.1
nameserver ::1

==> /tmp/resolv.conf.d <==
head: /tmp/resolv.conf.d: I/O error

==> /tmp/resolv.conf.ppp <==
nameserver 217.0.43.129
nameserver 217.0.43.145
# /etc/init.d/dnsmasq restart
udhcpc: started, v1.33.1
udhcpc: sending discover
udhcpc: no lease, failing
udhcpc: started, v1.33.1
udhcpc: sending discover
udhcpc: no lease, failing

and here the syslog

# cat /tmp/log/syslog 
Wed Oct  6 11:41:15 2021 user.notice dnsmasq: DNS rebinding protection is active, will discard upstream RFC1918 responses!
Wed Oct  6 11:41:15 2021 user.notice dnsmasq: Allowing 127.0.0.0/8 responses
Wed Oct  6 12:29:39 2021 daemon.crit dnsmasq[9104]: bad dhcp-option at line 32 of /var/etc/dnsmasq.conf.cfg01411c
Wed Oct  6 12:29:39 2021 daemon.crit dnsmasq[9104]: FAILED to start up
Wed Oct  6 12:29:44 2021 daemon.crit dnsmasq[9163]: bad dhcp-option at line 32 of /var/etc/dnsmasq.conf.cfg01411c
Wed Oct  6 12:29:44 2021 daemon.crit dnsmasq[9163]: FAILED to start up
Wed Oct  6 12:29:49 2021 daemon.crit dnsmasq[9164]: bad dhcp-option at line 32 of /var/etc/dnsmasq.conf.cfg01411c
Wed Oct  6 12:29:49 2021 daemon.crit dnsmasq[9164]: FAILED to start up
Wed Oct  6 12:29:54 2021 daemon.crit dnsmasq[9166]: bad dhcp-option at line 32 of /var/etc/dnsmasq.conf.cfg01411c
Wed Oct  6 12:29:54 2021 daemon.crit dnsmasq[9166]: FAILED to start up
1 Like
dhcp-option=office,192.168.0.1

"office" is is the network 192.168.0.0/24

Thanks, after your suggestion I get

# logread -e dnsmasq
Wed Oct  6 12:41:45 2021 user.notice dnsmasq: DNS rebinding protection is active, will discard upstream RFC1918 responses!
Wed Oct  6 12:41:45 2021 user.notice dnsmasq: Allowing 127.0.0.0/8 responses
Wed Oct  6 12:41:53 2021 daemon.crit dnsmasq[9503]: bad dhcp-option at line 33 of /var/etc/dnsmasq.conf.cfg01411c
Wed Oct  6 12:41:53 2021 daemon.crit dnsmasq[9503]: FAILED to start up
Wed Oct  6 12:41:58 2021 daemon.crit dnsmasq[9528]: bad dhcp-option at line 33 of /var/etc/dnsmasq.conf.cfg01411c
Wed Oct  6 12:41:58 2021 daemon.crit dnsmasq[9528]: FAILED to start up
root@OpenWrt:/etc/config# netstat -l -n -p | grep -e dnsmasq
[...]

whats on that line of that file

That's the same as before in row 32:

bogus-priv
conf-file=/usr/share/dnsmasq/rfc6761.conf
no-dhcp-interface=pppoe-wan
dhcp-range=set:office,192.168.0.100,192.168.0.249,255.255.255.0,12h
dhcp-range=set:home,192.168.1.100,192.168.1.249,255.255.255.0,12h
dhcp-option=home,192.168.0.1
dhcp-option=home,217.237.151.161
dhcp-option=home,8.8.8.8
dhcp-option=home,8.8.4.4
dhcp-option=home,1.1.1.1

Shouldn't that option line be

dhcp.office.dhcp_option='6,192.168.0.1,217.237.151.161,8.8.8.8,8.8.4.4,1.1.1.1'

If you're trying to set DNS servers for the clients

If you used LUCI, you'd see an example

for example 6,192.168.2.1,192.168.2.2

1 Like

Okay, now I have remove at both interfaces 'home' and 'office' the DHCP-options complete. Now the name resolution is running well.
Thanks for your support.
Finally, I would be interested in why entering these DHCP options for the interfaces blocks the name resolution on the router?

perhaps dnsmasq wasn't running at all - it tends to not start if the config file has an error in it

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.