OpenWrt Forum Archive

Topic: Router (only!) not able to resolve addresses

The content of this topic has been archived on 30 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi there -- here's another topic on DNS resolution as I have not been able to find a fix by reading other posts. Please bear with me and I would appreciate if you could point out the errors and advise on how to fix the problem.

Devices on my network are able to access the internet and resolve host names just fine, either because the custom DNS (Google's 8.8.8.8, 8.8.8.4) I have specified in my router's DHCP settings gets pushed to the client, or because the client has the above DNS servers hard-coded (I think there are some devices where I have specified DNS manually).

The router ITSELF though is unable to resolve host names, resulting in the familiar 'Bad address' message. This means that nslookup does not work, ddns fails to update and so on...

Example:

root@homeRouter:/tmp# nslookup google.com
Server:    127.0.0.1
Address 1: 127.0.0.1 localhost

nslookup: can't resolve 'google.com': Name or service not known

root@homeRouter:/tmp# nslookup google.com 8.8.8.8
Server:    8.8.8.8
Address 1: 8.8.8.8

nslookup: can't resolve 'google.com': Name or service not known


====================================================================


cat /tmp/log/myddns_ipv4.log


 143954       : ************ ************** ************** **************
 143954  note : PID '1747' started at 2017-06-22 14:39
 143954       : uci configuration:
ddns.myddns_ipv4.domain='********[redacted]********'
ddns.myddns_ipv4.enabled='1'
ddns.myddns_ipv4.interface='wan'
ddns.myddns_ipv4.ip_network='wan'
ddns.myddns_ipv4.ip_source='network'
ddns.myddns_ipv4.password='********[redacted]********'
ddns.myddns_ipv4.retry_interval='2'
ddns.myddns_ipv4.retry_unit='minutes'
ddns.myddns_ipv4.service_name='domains.google.com'
ddns.myddns_ipv4.use_logfile='1'
ddns.myddns_ipv4.use_syslog='2'
ddns.myddns_ipv4.username='********[redacted]********'
ddns.myddns_ipv4=service
 143954       : ddns version  : 2.4.3-2
 143954       : verbose mode  : 0 - run normal, NO console output
 143956       : check interval: 600 seconds
 143956       : force interval: 259200 seconds
 143956       : retry interval: 120 seconds
 143956       : retry counter : 0 times
 143956       : No old process
 143956       : last update: never
 143956       : Detect registered/public IP
 143956       : #> /usr/bin/nslookup '********[redacted]********'  >/var/run/ddns/myddns_ipv4.dat 2>/var/run/ddns/myddns_ipv4.err
 143956 ERROR : BusyBox nslookup error: '1'
 143957       : nslookup: can't resolve '********[redacted]********': Name or service not known
 143957       : Detect registered/public IP
 143957       : #> /usr/bin/nslookup '********[redacted]********'  >/var/run/ddns/myddns_ipv4.dat 2>/var/run/ddns/myddns_ipv4.err
 143957 ERROR : BusyBox nslookup error: '1'
 143957       : nslookup: can't resolve '********[redacted]********': Name or service not known
 143957  WARN : Get registered/public IP for '********[redacted]********'failed - retry 1/0 in 120 seconds
 144157       : #> /usr/bin/nslookup '********[redacted]********'  >/var/run/ddns/myddns_ipv4.dat 2>/var/run/ddns/myddns_ipv4.err
 144157 ERROR : BusyBox nslookup error: '1'

I am providing below the current configuration on all the relevant files and I'm hoping you can shed some light here:

/etc/resolv.conf

nameserver 127.0.0.1
nameserver 8.8.8.8
nameserver 8.8.4.4
cat /etc/hosts

127.0.0.1 localhost
cat /etc/config/network

config interface 'loopback'
        option ifname 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config globals 'globals'
        option ula_prefix 'fde1:ddd7:8a0b::/48'

config interface 'lan'
        option ifname 'eth0.1'
        option force_link '1'
        option type 'bridge'
        option proto 'static'
        option ipaddr '192.168.1.1'
        option netmask '255.255.255.0'
        option ip6assign '60'
        option delegate '0'


config interface 'wan'
        option ifname 'eth0.2'
        option _orig_ifname 'eth0.2'
        option _orig_bridge 'false'
        option proto 'pppoe'
        option username '********[redacted]********'
        option password  '********[redacted]********'
        option peerdns '0'
        option dns '8.8.8.8 8.8.4.4 208.67.222.222'

config interface 'wan6'
        option ifname 'eth0.2'
        option _orig_ifname 'eth0.2'
        option _orig_bridge 'false'
        option proto 'dhcp'
        option peerdns '0'
        option dns '2001:4860:4860::8888 2001:4860:4860::8844'

config switch
        option name 'switch0'
        option reset '1'
        option enable_vlan '1'

config switch_vlan
        option device 'switch0'
        option vlan '1'
        option ports '0t 2 3 4 5'

config switch_vlan
        option device 'switch0'
        option vlan '2'
        option ports '0t 1'

config interface 'vdsl_modem'
        option proto 'static'
        option ifname 'eth0.2'
        option ipaddr '192.168.0.2'
        option netmask '255.255.255.0'
        option gateway '192.168.0.1'
cat /etc/config/dhcp

config dnsmasq
        option domainneeded '1'
        option boguspriv '1'
        option localise_queries '1'
        option rebind_protection '1'
        option rebind_localhost '1'
        option local '/lan/'
        option expandhosts '1'
        option authoritative '1'
        option readethers '1'
        option leasefile '/tmp/dhcp.leases'
        option resolvfile '/tmp/resolv.conf.auto'
        option localservice '1'
        option strictorder '1'
        list server '8.8.8.8'
        list server '8.8.4.4'
        list server '208.67.222.222'
        option domain 'gd5.local'

config dhcp 'lan'
        option interface 'lan'
        option start '100'
        option limit '150'
        option leasetime '12h'
        list dhcp_option '1,255.255.255.0 3,192.168.1.1 6,8.8.8.8,8.8.4.4'

config dhcp 'wan'
        option interface 'wan'
        option ignore '1'

config odhcpd 'odhcpd'
        option maindhcp '0'
        option leasefile '/tmp/hosts/odhcpd'
        option leasetrigger '/usr/sbin/odhcpd-update'
root@homeRouter:/tmp# cat /tmp/resolv.conf
search gd5.local
nameserver 127.0.0.1
cat /tmp/resolv.conf.auto

# Interface wan
nameserver 8.8.8.8
nameserver 8.8.4.4
nameserver 208.67.222.222
# Interface wan_6
nameserver 2a02:587:101:0:212:205:212:205
nameserver 2a02:587:101:0:195:170:0:1
cat resolv.conf.ppp

nameserver 212.205.212.205
nameserver 195.170.0.1

Please help, por favor!

My two cents:

* You do not need to specify DNS servers on each interface, "list server" already tells DNSMASQ which servers to use.
* I would not inject google's DNS to the clients; let them use the router as a caching DNS instead.
* Use "host -v www.google.com" and see why DNSMASQ is not working.

The discussion might have continued from here.