Frequently Asked Question

Domain Nameserver, Zones and Records
Last Updated 7 years ago

The process by which you get from a domain name to a website isn't complex but its often misunderstood by those not in the industry and this article aims to explain this relationship in basic terms.

The Domain

When you register a domain, for example test.com then a registrar will keep the domain record which consists of the domain name, the registration date, renewal date, and a set of contact's such as owner, administrator, billing, technical and so on. The only slightly technical part of the domain registration is the name servers...

The Nameservers

When you register a domain name, one of the things you'll be asked for is the nameservers. Some domain registrars automatically set this to themselves and provide a 'control panel' type interface, but others do not and expect you to manager your own nameservers. Eitherway, the nameservers 'resolve' the domain name to the services it provides. As an example, you might have test.com hosted by GEN on our farpoint hosting cluster. The address of the first server in the cluster is farpoint1.gen.net.uk and let's assume that's where your site is hosted. In order to get from test.com to farpoint1.gen.net.uk we require a nameserver to make that resolution by holding the configuration in a zone...

The Zone

A nameserver is basically a database of records for a number of domain names. Each record is called a 'zone' and in the zone is configration information that is required to get from the domain name to an IP address (or some other data) that internet clients & servers require to work. A typical example would be the A record (A = Address), in our example test.com is hosted at farpoint1.gen.net.uk and that server is currenly at 81.174.253.181. So we need to get from www.test.com to 81.174.253.181 so your browser knows which server to connect to and the zone provides the answer.

Putting it all together

So in your browser you type www.test.com, and the browser has to first figure out the IP address that it needs to connect to. To do this it asks the nearest DNS server to provide the A (address) record for www.test.com. That nearest DNS server will first lookup the domain test.com and ask the registrar which nameserver provides answeres for test.com. Let's assume your hosting is with GEN so the registrar will return ns0.gen.net.uk, ns1.gen.net.uk which are our primary and backup nameservers.

Next the nearest DNS server has to ask the nameserver ns0.gen.net.uk what address it needs for www.test.com and in this case the question is actually; What is the www Address record for test.com, and if you hosted the domain at GEN then ns0.gen.net.uk would reply with "81.174.253.181", and that's all your browser needs to connect to the server and retrieve the website.

Let's work the example using some tools to get real world values...

So, firstly we need to know the nameservers for test.com, to do that we use the whois command:

whois test.com and we receive the response:

Name Server: NS65.WORLDNIC.COM
Name Server: NS66.WORLDNIC.COM

Great! Now we need to ask the first nameserver for the IP address for www.test.com and to do this we use the DIG command with this syntax

dig -t A www.test.com @ns65.worldnic.com

This asks for the A record for www.test.com from the nameserver ns65.worldnic.com and we get the following response:

;; QUESTION SECTION:
;www.test.com.IN A

;; ANSWER SECTION:
www.test.com.3600 IN A 69.172.200.235

As we can see our question was, what is the A record (address) for www.test.com and the answer given is 69.172.200.235 which is exactly what we needed.

Now we can connect to 69.172.200.235 and retrieve the website hosted at that address. We can test this further using the CURL command

curl --verbose --header "host: www.test.com" 69.172.200.235

And we get the following answer:

* Trying 69.172.200.235...
* TCP_NODELAY set
* Connected to 69.172.200.235 (69.172.200.235) port 80 (#0)
> GET / HTTP/1.1
> host: www.test.com
> User-Agent: curl/7.51.0
> Accept: */*
>


What we see here is that the server hosting www.test.com is attempting to redirect us to https://www.test.com and that's not uncommon, but we don't need to test this further, we have our valid response from the server to our request so we know its all working.

We hope this helps explain the relationship between domain name, nameserver, zone and hosting server, but if not then please don't hesitate to contact us.

Please Wait!

Please wait... it will take a second!