I'm looking into a simple split horizon DNS implementation. Using GoDaddy for my Internet DNS and Microtik routers for LAN DNS in a couple locations.
In my office I have a server, on the Internet is hq.company.com
, but on my office network, I've been using a DNS entry on the Microtik with a different name hq.internal.company.com
.
My most naive guess at a 'split horizon' implementation was to make an entry in the Microtik router with the same name as the GoDaddy entry, hq.company.com
.
However, having done that I can see it's not working as I'd hoped. Both addresses are coming through in random order when using the host
command. I've also tried clearing my laptop's (OSX) local DNS cache too.
$ host hq.company.com
hq.company.com has address 192.168.88.177
hq.company.com has address 150.243.157.82
$ host hq.company.com
hq.company.com has address 150.243.157.82
hq.company.com has address 192.168.88.177
$ host hq.company.com
hq.company.com has address 192.168.88.177
hq.company.com has address 150.243.157.82
My desired behavior is, when I'm in the office, local DNS provides only the local address for hq.company.com
, and when I'm not in the office, GoDaddy DNS provides for the public IP.