Router can't resolve its own name

Hello,
strange problem here. My router (single dns in the network) can't resolve its own hostname (alone or with the .lan domain).
The configuration is quite simple, i do not have multiple instances, just this:

  2 config dnsmasq
  3         option localise_queries '1'
  4         option rebind_protection '1'
  5         option cachesize '0'
  6         option authoritative '1'
  7         option readethers '1'
  8         option leasefile '/tmp/dhcp.leases'
  9         option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
 10         option localservice '1'
 11         option ednspacket_max '1232'
 12         option confdir '/tmp/adblock-blocklist'
 13         option quietdhcp '1'
 14         option domain 'lan'
 15         option local '/lan/'
 16         option nonwildcard '0'

what i get trying to get the name resolved is this

PS D:\> ping rutto
Impossibile trovare l'host rutto. Verificare che il nome sia corretto e riprovare.
PS D:\> ping rutto.lan
Impossibile trovare l'host rutto.lan. Verificare che il nome sia corretto e riprovare.
PS D:\> nslookup rutto
Server:  mqttBroker
Address:  192.168.1.1

*** mqttBroker non è in grado di trovare rutto: Non-existent domain
PS D:\> nslookup rutto.lan
Server:  mqttBroker
Address:  192.168.1.1

*** mqttBroker non è in grado di trovare rutto.lan: Non-existent domain

(mqttbroker is a hostname i have configured with the same ip address of the router, nothing strange)

but as soon as i try to resolve another name (local or public):

PS D:\> nslookup accesspoint
Server:  mqttBroker
Address:  192.168.1.1

Nome:    accesspoint.lan
Address:  192.168.1.2

i have no clue what to look for.. any idea?
useless to say, i can perfectly ping the router and access it via its ip address..
thanks

Can we see the full "/etc/config/dhcp", and also "/etc/config/system", please?

1 Like

sure!
system:

 2 config system
 3         option hostname 'RUTTO'
 4         option timezone 'CET-1CEST,M3.5.0,M10.5.0/3'
 5         option ttylogin '0'
 6         option log_size '64'
 7         option urandom_seed '0'
 8         option zonename 'Europe/Rome'
 9         option log_proto 'udp'
10         option conloglevel '8'
11         option cronloglevel '5'
12
13 config timeserver 'ntp'
14         option enable_server '1'
15         list server 'europe.pool.ntp.org'
16         list server 'time.cloudflare.com'
17         list server 'time.windows.com'
18         list server 'time.nist.gov'
19         list server 'time.google.com'
20         list server '0.openwrt.pool.ntp.org'

dhcp

 2 config dnsmasq
  3         option localise_queries '1'
  4         option rebind_protection '1'
  5         option cachesize '0'
  6         option authoritative '1'
  7         option readethers '1'
  8         option leasefile '/tmp/dhcp.leases'
  9         option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
 10         option localservice '1'
 11         option ednspacket_max '1232'
 12         option confdir '/tmp/adblock-blocklist'
 13         option quietdhcp '1'
 14         option domain 'lan'
 15         option local '/lan/'
 16         option nonwildcard '0'
 17
 18 config dhcp 'lan'
 19         option interface 'lan'
 20         option start '100'
 21         option limit '150'
 22         option leasetime '12h'
 23         option dhcpv4 'server'
 24
 25 config odhcpd 'odhcpd'
 26         option maindhcp '0'
 27         option leasefile '/tmp/hosts/odhcpd'
 28         option leasetrigger '/usr/sbin/odhcpd-update'
 29         option loglevel '3'
 30
 31 config dhcp 'DMZ'
 32         option interface 'DMZ'
 33         option start '100'
 34         option limit '150'
 35         option leasetime '12h'
 36
 37 config dhcp 'Guest'
 38         option interface 'Guest'
 39         option start '100'
 40         option limit '150'
 41         option leasetime '12h'
 42
 43 config domain
 44         option name 'mqttBroker'
 45         option ip '192.168.1.1'
 46
 47 config host
 48         option name 'MULTIMEDIA'
 49         option mac 'xx:xx:xx:xx:xx:xx'
 50         option ip '192.168.111.175'
 51         option broadcast '1'
 52         option dns '1'

(i removed the long list of following hosts, for static leases)

thanks

What happens if you remove the other hostname(s) for the router, Save & Apply and retest.

Remove these lines, and try again:

If it works, use an alias instead of a domain name (I would use an alias in any case).

2 Likes

hello,
it has the very same behaviour both deleting static leases and deleting the "domain" (in luci, hostnames) entry.

The only difference is that nslookup seems to know who RUTTO is, but not resolving it

PS D:\> ping rutto
Impossibile trovare l'host rutto. Verificare che il nome sia corretto e riprovare.
PS D:\> ping rutto.lan
Impossibile trovare l'host rutto.lan. Verificare che il nome sia corretto e riprovare.
PS D:\> nslookup rutto
Server:  RUTTO
Address:  192.168.1.1

*** RUTTO non è in grado di trovare rutto: Non-existent domain

any other idea? since i'm on 23.05.2 i'll probably try to update to .5, but i'm having problems building with imagebuilder..
or maybe i should start all the config from scratch..

PS: what do you mean with alias? do you mean a cname entry?

thanks

Can you repeat the tests from the router, not from a computer?

I'm trying via wireguard from the phone so not posting logs :slight_smile:

  • nslookup: the server is 127.0.0.1 and "server can't find rutto.lan"
  • ping rutto: it answers, rotating the ip between all the ip of the router (one for each vlan) (once upon a time i can remember getting the nslookup on clients with the list of ips of the router..)
  • ping rutto.lan says "bad address" O_O

Thanks

i also updated to 23.05.5
and tried both dnsmasq and dnsmasq-full
i still get this behavior from the router itself

root@RUTTO:~# ping rutto
PING rutto (10.0.0.1): 56 data bytes
64 bytes from 10.0.0.1: seq=0 ttl=64 time=0.030 ms
64 bytes from 10.0.0.1: seq=1 ttl=64 time=0.051 ms
^C
--- rutto ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 0.030/0.040/0.051 ms
root@RUTTO:~# nslookup rutto
Server:         127.0.0.1
Address:        127.0.0.1:53

** server can't find rutto.lan: NXDOMAIN

** server can't find rutto.lan: NXDOMAIN

root@RUTTO:~# ping rutto.lan
ping: bad address 'rutto.lan'
root@RUTTO:~# nslookup rutto.lan
Server:         127.0.0.1
Address:        127.0.0.1:53

** server can't find rutto.lan: NXDOMAIN

** server can't find rutto.lan: NXDOMAIN

when i ping its name, i ping only the ip of one of my subnet, always the same (it is not rotating), if i stop that interface the ip used changes to the one of another subnet, so it seems he knows himself somehow :slight_smile:
but i expect nslookup to return the list of ip..

if anyone passes here, this is the solution

option expandhosts '1'
1 Like

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