DNS resolution fails for hostname mapped to 192.168 address on some machines

dns

I have a domain name mapped to a local subnet address so I can easily test across devices (test.internetdancefloor.com maps to 192.168.1.88 or something like that). This address works from my Windows machines, however it does not work from my android devices or Mac. When I run nslookup on my mac, DNS fails:

users-mbp:~ user$ nslookup internetdancefloor.com
Server:     192.168.1.1
Address:    192.168.1.1#53

Non-authoritative answer:
Name:   internetdancefloor.com
Address: 174.127.248.98

users-mbp:~ user$ nslookup test.internetdancefloor.com
Server:     192.168.1.1
Address:    192.168.1.1#53

Non-authoritative answer:
*** Can't find test.internetdancefloor.com: No answer

Any idea why nslookup for test.internetdancefloor.com succeeds for some machines but not others?

My hypothesis is that the DNS client on mac and android devices rejects local subnet IP addresses, because I added a traditional DNS entry (version.internetdancefloor.com) later and it works fine across devices. I haven't been able to very this hypothesis otherwise.

@Alex:

users-MacBook-Pro:videoplayer user$ cat /etc/resolv.conf 
#
# Mac OS X Notice
#
# This file is not used by the host name and address resolution
# or the DNS query routing mechanisms used by most processes on
# this Mac OS X system.
#
# This file is automatically generated.
#
nameserver 192.168.1.1

Update:

We observed that the Mac is using the router directly as a DNS server, rather than the DNS servers the router is configured to use. My windows machine does not use the router (192.168.1.1) as the DNS server, but rather picks up the static IPs the router is configured to use (via DHCP I guess).

When I use nslookup from my PC but select the DNS server, I see that the router is the one failing the DNS requests and not the upstream DNS servers. When I don't specify a DNS server, it does not default to 192.168.1.1 but rather uses the upstream DNS server directly (208.76.152.1)

C:\src> nslookup test.internetdancefloor.com
Server:  DNSresolver-A.spectrumnet.us
Address:  208.76.152.1

Non-authoritative answer:
Name:    test.internetdancefloor.com
Address:  192.168.1.88

C:\src> nslookup test.internetdancefloor.com 208.76.152.1
Server:  DNSresolver-A.spectrumnet.us
Address:  208.76.152.1

Non-authoritative answer:
Name:    test.internetdancefloor.com
Address:  192.168.1.88

C:\src> nslookup test.internetdancefloor.com 192.168.1.1
Server:  unknown
Address:  192.168.1.1

*** No internal type for both IPv4 and IPv6 Addresses (A+AAAA) records available for test.internetdancefloor.com

It seems unnatural to configure my android and Mac devices to use a particular DNS server, though I suppose that would work. Maybe my router is filtering certain DNS results that point to the same subnet, and that can be undone. I wonder why my Mac/Android devices choose 192.168.1.1 for their DNS server? Those devices are on a wireless connection while my PCs are wired, so perhaps its a wireless/wired difference.

Best Answer

Thanks @alex-mckenzie for leading me to the answer.

My wireless router was telling clients (via DHCP) to use it as the DNS proxy server. For some reason that router wouldn't resolve IP addresses within the local subnet. The router software is TomatoUSB. There is a DHCP configuration setting "Use internal DNS" enabled. Once I disabled it, clients connecting via DHCP would use the upstream DNS servers directly.

I've noticed that DNS requests often fail the first time I hit a domain, I'm hoping that issue is fixed too.

Related Question