Local DNS does not work in 21.02 does in 19.07

I have 2 identical routers (used as access point): D-Link DAP-2695 rev. A1

  • dap-beneden:
    OpenWrt 19.07.4
    192.168.3.20
  • dap-boven:
    OpenWrt 21.02.1
    192.168.3.21
    Upgraded to 21.02.1 without keeping settings -> fresh install from a sysupgrade image
  • both routers used as "access points only":
    Lan interface only (all others removed)
    DHCP server disabled on Lan interface (my own server hands out ip-addresses)
    Static ip-address
    custom DNS server: 192.168.3.1

The problem:
On dap-beneden local dns works, on dap-boven it does not.
(clients work perfectly dns information is handed to them by my own dhcp server)

dap-beneden:

root@dap-beneden:~# uci show network.lan
network.lan=interface
network.lan.type='bridge'
network.lan.proto='static'
network.lan.netmask='255.255.255.0'
network.lan.ip6assign='60'
network.lan.ipaddr='192.168.3.20'
network.lan.gateway='192.168.3.1'
network.lan.ifname='eth0 eth0.1'
network.lan.dns='192.168.3.1'
network.lan.ipv6='off'
root@dap-beneden:~# nslookup mini-server
Server:         192.168.3.1
Address:        192.168.3.1#53

Name:      mini-server
Address 1: 192.168.3.202
*** Can't find mini-server: No answer

dap-boven:

root@dap-boven:~# uci show network.lan
network.lan=interface
network.lan.device='br-lan'
network.lan.proto='static'
network.lan.netmask='255.255.255.0'
network.lan.ip6assign='60'
network.lan.ipaddr='192.168.3.21'
network.lan.gateway='192.168.3.1'
network.lan.dns='192.168.3.1'
root@dap-boven:~# nslookup mini-server
Server:         127.0.0.1
Address:        127.0.0.1#53

*** Can't find mini-server: No answer
*** Can't find mini-server: No answer

Did you completely stop the dnsmasq server in boven? This is serving as dns forwarder, so you'd need to adjust the /etc/resolv.conf to point directly to .3.1 nameserver.

Okay, when I add nameserver to resolv.conf it indeed works. Thank you, @trendy!

I did not have to do that in version 19. I used luci for that.
And I assumed that because dns field below is offered, it would work the same in version 21.
Was I wrong to assume that?

image

Can you run this on both routers?

Please run the following commands (copy-paste the whole block) and paste the output here, using the "Preformatted text </> " button:
grafik
Remember to redact passwords, MAC addresses and any public IP addresses you may have

ubus call system board; netstat -lnp | grep 53; \
ls -l  /etc/resolv.* /tmp/resolv.* /tmp/resolv.*/* ; head -n -0 /etc/resolv.* /tmp/resolv.* /tmp/resolv.*/*

dap-beneden

root@dap-beneden:~# ubus call system board; netstat -lnp | grep 53; \
> ls -l  /etc/resolv.* /tmp/resolv.* /tmp/resolv.*/* ; head -n -0 /etc/resolv.* /tmp/resolv.* /tmp/resolv.*/*
{
        "kernel": "4.14.195",
        "hostname": "dap-beneden",
        "system": "Qualcomm Atheros QCA9558 ver 1 rev 0",
        "model": "D-Link DAP-2695 rev. A1",
        "board_name": "dap-2695-a1",
        "release": {
                "distribution": "OpenWrt",
                "version": "19.07.4",
                "revision": "r11208-ce6496d796",
                "target": "ar71xx/generic",
                "description": "OpenWrt 19.07.4 r11208-ce6496d796"
        }
}
ls: /tmp/resolv.*/*: No such file or directory
lrwxrwxrwx    1 root     root            16 Sep  6  2020 /etc/resolv.conf -> /tmp/resolv.conf
lrwxrwxrwx    1 root     root            21 Aug 30 15:46 /tmp/resolv.conf -> /tmp/resolv.conf.auto
-rw-r--r--    1 root     root            39 Aug 30 15:46 /tmp/resolv.conf.auto
==> /etc/resolv.conf <==
# Interface lan
nameserver 192.168.3.1

==> /tmp/resolv.conf <==
# Interface lan
nameserver 192.168.3.1

==> /tmp/resolv.conf.auto <==
# Interface lan
nameserver 192.168.3.1
head: /tmp/resolv.*/*: No such file or directory
root@dap-beneden:~# 

dap-boven

root@dap-boven:~# ubus call system board; netstat -lnp | grep 53; \
> ls -l  /etc/resolv.* /tmp/resolv.* /tmp/resolv.*/* ; head -n -0 /etc/resolv.* /tmp/resolv.* /tmp/resolv.*/*
{
        "kernel": "5.4.154",
        "hostname": "dap-boven",
        "system": "Qualcomm Atheros QCA9558 ver 1 rev 0",
        "model": "D-link DAP-2695-A1",
        "board_name": "dlink,dap-2695-a1",
        "release": {
                "distribution": "OpenWrt",
                "version": "21.02.1",
                "revision": "r16325-88151b8303",
                "target": "ath79/generic",
                "description": "OpenWrt 21.02.1 r16325-88151b8303"
        }
}
lrwxrwxrwx    1 root     root            16 Oct 24 11:01 /etc/resolv.conf -> /tmp/resolv.conf
-rw-------    1 root     root            34 Jan 14 08:29 /tmp/resolv.conf
-rw-r--r--    1 root     root            39 Jan 12 16:34 /tmp/resolv.conf.d/resolv.conf.auto

/tmp/resolv.conf.d:
-rw-r--r--    1 root     root            39 Jan 12 16:34 resolv.conf.auto
==> /etc/resolv.conf <==
search lan
nameserver 192.168.3.1

==> /tmp/resolv.conf <==
search lan
nameserver 192.168.3.1

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

==> /tmp/resolv.conf.d/resolv.conf.auto <==
# Interface lan
nameserver 192.168.3.1
root@dap-boven:~# 

dnsmasq is not running on neither of them, so leaving the 127.0.0.1 as nameserver on the second one was causing the issue.

1 Like

Thanks! This weekend I will upgrade the second one too :slight_smile:

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