Hi,
I have a setup with 4 devices.
- router.mydomain.lan 192.168.100.1
- ap.mydomain.lan 192.168.100.2 (connected by cable to the router)
- wifi-bridge.mydomain.lan 192.168.100.3 (connected over WiFi as WDS Client to the WDA AP)
- laptop.mydomain.lan 192.168.100.4 (connected via cable to wifi-bridge)
+------+ +--+ +-----------+ +------+
|Router+--+AP| |WiFi Bridge+--+Laptop|
+------+ +--+ +-----------+ +------+
On the router, there are all 4 hostnames added.
/etc/init.d/dnsmasq reload && /etc/init.d/dnsmasq restart is done accordingly and after updating settings.
On the laptop/debian, DNS Server is set correctly in network settings, it's received by DHCP.
root@laptop:~$ nslookup router.mydomain.lan
Server: 192.168.100.1
Address: 192.168.100.1#53
Name: router.mydomain.lan
Address: 192.168.100.1
When i do nslookup on my Router, it's working also. A mix out Domain/Hostnames and /etc/hosts is resolved correctly on localhost.
root@router:~# nslookup router.mydomain.lan
Server: 127.0.0.1
Address: 127.0.0.1#53
Name: router.mydomain.lan
Address 1: 192.168.100.1
root@router:~# nslookup ap.mydomain.lan
Server: 127.0.0.1
Address: 127.0.0.1#53
Name: ap.mydomain.lan
Address 1: 192.168.100.2
root@router:~# nslookup wifi-bridge.mydomain.lan
Server: 127.0.0.1
Address: 127.0.0.1#53
Name: wifi-bridge.mydomain.lan
Address 1: 192.168.100.3
So the laptop has received DNS via DHCP and uses router.mydomain.lan/192.168.100.1 for NSLOOKUP.
The router used localhost and was able to resolve hostnames.
On the AP and the Wifi-Bridge i have a different behaviour. Both are freshly deployed with OpenWRT v22.03.3
root@ap:~# nslookup router.mydomain.lan
Server: 127.0.0.1
Address: 127.0.0.1:53
root@wifi-bridge:~# nslookup router.mydomain.lan
Server: 127.0.0.1
Address: 127.0.0.1#53
Both use localhost/127.0.0.1 as the DNS-Server.
When i explicitly specify the DNS-Server, it will let me resolve the Hostname.
So the issue is not on the router.mydomain.lan device.
root@ap:~# nslookup router.mydomain.lan 192.168.100.1
Server: 192.168.100.1
Address: 192.168.100.1:53
Name: router.mydomain.lan
Address: 192.168.100.1
root@wifi-bridge:~# nslookup router.mydomain.lan 192.168.100.1
Server: 192.168.100.1
Address: 192.168.100.1#53
Name: router.mydomain.lan
Address: 192.168.100.1
my settings:
root@ap:~# cat /etc/config/network
config interface 'lan'
option device 'br-lan'
option proto 'static'
option netmask '255.255.255.0'
option ip6assign '60'
option ipaddr '192.168.100.2'
option gateway '192.168.100.1'
list dns '192.168.100.1'
list dns_search 'lan'
root@ap:~# cat /etc/config/dhcp
config dnsmasq
option domainneeded '1'
option localise_queries '1'
option rebind_protection '1'
option rebind_localhost '1'
option expandhosts '1'
option readethers '1'
option leasefile '/tmp/dhcp.leases'
option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
option localservice '1'
option ednspacket_max '1232'
list server '192.168.100.1'
list server '192.168.100.1' & list dns '192.168.100.1' <-- i expected one of these to solve my issues.
I'm now reading the documentation cross in all directions, but i miss the option to tell the System to pick a different and specified DNS-Server instead of localhost.
To forward every local-FQDN hostname like *.mydomain.lan => DNS Server 192.168.100
What do i miss here?