Creating Windows Server 2008 DNS Zones to Resolve External URLs to Internal IP Addresses

In our public-facing website environment we resolve URLs via our gateway to a hardware load balancer, and then on to our web front-end SharePoint 2010 servers. This all works well, and externally we can resolve www.mydomain.com. Internally however, I wanted to resolve the same URL to my internal IP addresses without having to hack hosts files or make other nasty changes.

This can be done via Windows 2008 DNS server when creating a default primary authorative zone. Normally you would create a zone for mydomain.com and then add a host entry for “www”. This would however have the effect that the DNS server became authoratative for the entire mydomain.com domain, which I did not want as there are other mydomain.com addresses that our environment does not host.

The solution is to create a primary DNS zone matching the full URL, www.mydomain.com.

DNS primary zone entry

DNS primary zone entry

Then, you create a blank A record pointing to the internal IP address of your website:

Create a blank A record

Create a blank A record

This A record becomes the default entry for the zone, so internal requests for www.mydomain.com will resolve to your A-record, but any requests for other URLS in the mydomain.com space will be forwarded via normal DNS processes.

Advertisements

2 Responses to “Creating Windows Server 2008 DNS Zones to Resolve External URLs to Internal IP Addresses”

  1. Nag Says:

    how can i point one external url to a internal server?

    • gavinmckay Says:

      You could only point an external url to an internal server if your adjust what your browser/application uses to map the url to an IP address i.e. DNS settings. There are a couple of different ways but some simple ones are:

      1. Change the internal DNS server in your organisation. This assumes of course that you have an internal DNS server! Doing this change would effect all computers in your internal network.
      2. Add an entry to the hosts file mapping the url to an ip address (by default in windows this is in c:\windows\system32\drivers\etc and the file is “hosts.” i.e. no extension. This change needs to be done on every computer.

      There are other ways, but they are probably the quickest.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: