0

I have a Microsoft DNS server setup and running for my local domain (mydomain.local). I have set up a public domain since then (mydomain.com) and want all my local clients to have different A hosts for mydomain.com while they are on the local network. If they are remote I want them to get the resolutions anyone would get on the internet from the public DNS server (hosted elsewhere).


Scenario 1: Internal

client1.mydomain.local is a PC on my local network and tries to resolve test.mydomain.com. That client should get back 192.168.1.100. When the client tries to resolve test2.mydomain.com it should get back 192.168.1.101. Then last when the client tries to resolve test3.mydomain.com it should get back 8.8.3.6.

Scenario 2: External

client2 is a PC somewhere else in the world and tries to resolve test.mydomain.com. That client should get back 8.8.3.4. When the client tries to resolve test2.mydomain.com it should get back 8.8.3.5. Then last when the client tries to resolve test3.mydomain.com it should get back 8.8.3.6.


Currently I have my local DNS server (mydomain.local) setup with the new domain (mydomain.com) and only have a few select A hosts in it (test, test2 but NOT test3). My goal is to somehow forward the DNS requests to a specific DNS server that are not in my (mydomain.com) zone. At this point when I try to resolve test1.mydomain.com and test2.mydomain.com they resolve great! But when I try to resolve test3.mydomain.com it fails and does not resolve.

  • If you want to achieve that from a single server it's called split horizon DNS and according to this answer that is not supported in Windows 2012. – HBruijn May 6 '15 at 14:44
0

OK I found two methods of doing what I want...

Method #1: Zone Per Host

This method is crude and somewhat messy if you have a bunch of hosts you need to work with, but in my case I only had a few so it worked great for me and this is the method I went with...

First you have your DNS zone hosted with a third party (in my case it was with Godaddy). This is what is used for the public (internet) to resolve test.mydomain.com and the clients on the internet side would get back 8.8.3.4. That's what I already had in place and now I need my internal network to resolve those hosts differently. So I did the following...

Create a new zone on your local network DC called "test.mydomain.com". In that zone create an "A-Host" record, do not enter anything into the first field called "Name", just leave it blank. Then enter your LOCAL internal IP in the "IP Address" field. In my case I used "192.168.1.100".

Now I test with a client on the internet (outside the office) and test.mydomain.com resolves to 8.8.3.4! And the client on my local network resolves test.mydomain.com to 192.168.1.100!!!


Method #2: Two Zones, One For Internal And One For External

This is the less messy way of doing it but requires more upkeep. In this method you will need to keep multiple zone in multiple locations up to date. I chose not to go this route just because of the upkeep. If you have a bunch of hosts and want a clean look this might be the method for you.

Create a new zone on your local network DC. Call the zone "mydomain.com". Now replicate manually all the records from the (in my case GoDaddy hosted) zone to the newly created zone in your local DC. Once you have done that just change the records you want to be different for internal use. This in essence kinda hijacks the zone. So if you hop on godaddy and update the zone with a new a-host or change an existing one you will need to do the same thing on your local DC server to reflect the changes.

  • A zone per host sounds really messed up, but what you want to achieve is very interesting to start with. I prefer method #2 - one zone for mydomain.com and you just need to put whatever A records you want in there. E.g. test1->192.x, test2->192.x, but test3->8.x – strongline May 6 '15 at 19:40
  • Yes like I said in my answer, Zone Per Host is only in cases where you only need 1 or 2 hosts to accomplish your goal, in my case it works great! But interesting or not this issue has been around forever and microsoft has never tried to support it. It's not an uncommon task to have your local network point to a local address instead so you don't go outside the firewall then loop back into the server that is on the same network in the first place. – Arvo Bowen May 7 '15 at 7:57
  • I am with MS on this. Internally you should be using .local domain. There is public DNS responsible for .com public domain, it's very confusing, sometimes risky, to support what you asked for. – strongline May 7 '15 at 12:35
  • Understood... To put it simply there is a "best practice" and a "practical practice". In my mind keeping up with two zones is more of a pain then I care about. Especially when the both of them are almost identical with the exception of two hosts. – Arvo Bowen May 7 '15 at 18:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.