The problem: I have two computers on my wireless network (domain name "serenity", at 192.168.1.1), hostnames "jayne" (Arch Linux, at 192.168.1.108), and "mal" (Mac OS X, at 192.168.1.101). When I try to get the two to communicate, this happens:
jayne$ ping mal
PING mal.serenity (184.106.31.161) ... [pings go through to weird IP]
and
mal$ ping jayne
PING jayne.serenity (184.106.31.161) ...
However, pinging the router works:
jayne or mal$ ping serenity
PING serenity.serenity (192.168.1.1) ...
And then things get weird:
jayne or mal$ ping google
PING google.serenity (184.106.31.161) ... [same IP as before]
jayne or mal$ ping google.com
PING google.com (74.125.115.106) ... [works as expected]
jayne$ ping 192.168.1.101
PING 192.168.1.101 (192.168.1.101) ... [works as expected]
So why can't mal or jayne see each other?
The catch: serenity is currently connected to another, pre-existing router (it doesn't have a domain name) which is the primary gateway to the internet, located at 192.168.0.1. I set up a static DHCP rule to always map serenity to 192.168.0.2.
Now, I noticed that when I go to a non-existent URL in my browser, I get redirected to my ISP's "Search the internet for *" page, so I figured the weird IP addresses the pings were resolving to probably belonged to whatever server handled that on the ISP, and changed the DNS servers on the .0.1 router to Google's Public DNS service.
Now, ping mal
or ping jayne
don't resolve at all ("ping: unknown host mal", "ping: cannot resolve jayne: Unknown host"), even with "full" names (like "mal.serenity"), but I can still successfully ping serenity
.
So why can't mal or jayne see each other?
I'm not really a network-y guy, so I probably just have a setting wrong somewhere, but in the mean time I'm using hosts
files to get around this, by manually mapping the host names to IP addresses, but that's just fixing the symptom, not the problem.