Setup
On some networks I'm able to use nslookup
to resolve a domain name that is pointed to a private ip address:
@work> nslookup my192.ddns.net
Server: 10.1.2.3
Address: 10.1.2.3#53
Non-authoritative answer:
Name: my192.ddns.net
Address: 192.168.20.20
However, on my home network this same query fails:
@home> nslookup my192.ddns.net
Server: 192.168.0.1
Address: 192.168.0.1#53
Non-authoritative answer:
*** Can't find my192.ddns.net: No answer
What Works
I've found that if I change the A record for my192.ddns.net
so that it points to a public IP range it will work fine:
@home> nslookup my192.ddns.net
Server: 192.168.0.1
Address: 192.168.0.1#53
Non-authoritative answer:
Name: my192.ddns.net
Address: 172.217.12.238
At home, if I specify the DNS server for nslookup, or set my laptop's DNS servers to Google's nslookup
works as expected:
@home> nslookup my192.ddns.net 8.8.8.8
Server: 8.8.8.8
Address: 8.8.8.8#53
Non-authoritative answer:
Name: my192.ddns.net
Address: 192.168.20.20
But I'd like to continue to use my home router as my primary DNS so that it can resolve local network names. I'd just like it not to fail when trying to do lookups for DNS records that point to private range addresses (eg: 192.168.20.20
)
Home Network
I run LEDE (formerly OpenWRT) on my home router, which run dnsmasq
. I've looked over the documentation for DNS and have even setup the system so that the DNS server it uses to resolve the address is Google's (8.8.8.8
) - but it still fails and I can't seem to figure out why.
Question
What's happening here and how can I fix it?