I have a DNS server in my local network (PiHole) at 192.168.1.10.
While I have already been successful on assining this DNS to DHCP clients (LuCI -> Interfaces -> LAN -> DHCP Server -> Advanced Settings -> DHCP Options -> "6,192.168.1.10"), I cannot make it work in an SSH session to OpenWRT.
I've already changed all possible settings:
Network -> Interfaces -> LAN -> Advanced Settings -> Use custom DNS servers -> 192.168.1.10
Network -> Interfaces -> WAN -> Advanced Settings -> Use custom DNS servers -> 192.168.1.10
Network -> DHCP and DNS -> DNS forwardings -> 192.168.1.10
And I cannot get the OpenWRT SSH to use my DNS server (LAN interface). See below, with all the above configuration OpenWRT is still not able to resolve a local name "ap3.home". However my DNS is working fine as the example below shows when I force nslookup to use my server:
Also permitted is a -S flag which gives a domain but no IP address; this tells dnsmasq that a
domain is local and it may answer queries from /etc/hosts or DHCP but should never forward
queries on that domain to any upstream servers. --local is a synonym for --server to make
configuration files clearer in this case.
LuCI also tells you
Local domain specification. Names matching this domain are never forwarded and are resolved
from DHCP or hosts files only
"dhcp.@dnsmasq[0].local" back to "lan", I just disabled rebind protection and now it is working!
uci del dhcp.cfg01411c.rebind_localhost
uci set dhcp.cfg01411c.rebind_protection='0'
root@ap1-router:~# ping ap3.home
PING ap3.home (192.168.1.3): 56 data bytes
64 bytes from 192.168.1.3: seq=0 ttl=64 time=7.828 ms
64 bytes from 192.168.1.3: seq=1 ttl=64 time=0.834 ms
64 bytes from 192.168.1.3: seq=2 ttl=64 time=1.301 ms
^C