Taking advantage of the fact that DNS will always respond with an authoritative answer if it has one allows exceptions for single hosts. In essence, using DNS as a centralised hosts file.

This is a usage scenario:

  1. Using a private AD domain. e.g. internal.indented.co.uk
  2. Hosting a public web server within the AD domain. e.g. www.indented.co.uk
  3. Internal clients cannot access the server using the public IP (a routing restriction)

At this point DNS can be used in two ways to address the issue.

Either claim authority for the entire domain, e.g. indented.co.uk. The disadvantage of this is that every other record under the domain must be duplicated in the private version (Split Brain DNS) or it will fail to resolve. For example, attempting to access portal.indented.co.uk would fail unless it was also added.

Or, a zone can be created using the full name of the service, i.e. naming the zone www.indented.co.uk. Adding a Host (A) record to the zone with a blank name will allow the zone name to resolve to an IP address, in exactly the same way as names other domains are resolved.

The full step of steps for this is as follows:

  1. Open the DNS Console (from Administrative Tools)
  2. Expand Forward Lookup Zones
  3. Create a new zone
  4. Type is either (Standard) Primary or Primary and Active Directory Integrated
  5. Replication Scope can remain default (if applicable)
  6. Zone Name should be the name of the host, e.g. www.indented.co.uk
  7. Select “Do not allow dynamic updates”
  8. Finish

Then add a record so the name resolves back to an IP:

  1. Select the new zone (e.g. www.indented.co.uk)
  2. Right click and select “New Host (A)…”
  3. Leave the Name Blank
  4. Enter the IP Address

Note that an Alias, or CNAME, cannot be used. CNAME records cannot share resource names. In this case the resource name is www.indented.co.uk and is currently shared with NS records and the SOA record because it is being treated as a domain.

Finally, the change can be tested by running these commands:
[code lang=”plain”]
nslookup www.indented.co.uk
ipconfig /flushdns
ping www.indented.co.uk

Leave a Reply

Your email address will not be published. Required fields are marked *