Understanding The Domain Name Structure

Domain-name-structureTo understand the domain name structure you really need to understand the problem the structure was meant to solve.

The Domain Name Structure and Domain Name System were developed to organise and find the IP addresses of Computers on large distributed networks.



Before the domain name structure was developed computer names and IP addresses were mapped using a flat list and stored in a simple text file called the hosts file.

This file was maintained separately by each user on their own computer.

This mapping looked like this:

hosts-file-example

This kind of structure works well for a small number of machines on a small local network, but doesn’t’ work well when you have lots of machines spread over different networks.

Lets take an example of two networks with two different administrators who have been responsible for assigning names and IP addresses on their own networks.

Lets assume that each network has a mail server, and each administrator has created a hosts file for all of their network users.

The hosts file for network 1 might look like this:

Mailserver 192.168.1.1

and the host file for network 2 might look like this

Mailserver 192.168.0.1

As you can see both administrators have chosen the same name but the mail servers are on different machines.

If we were now to connect these two networks together and create a single host file for the combined network we would have to rename one or both of the mail servers.

So our new hosts file would look like this:

Mailserver1 192.168.1.1
Mailserver2 192.168.0.1

The situation described above is easily manageable with just two networks, and two mail servers, but is not so easy when we have thousands of servers and networks joined together.

To solve this problem we need to give the machine names some type of structure, so that even if the administrators of each network were to choose the same names, it wouldn’t matter.

We could use the network names as part of the naming structure so we could have:

mailserver in Network 1 and mailserver in Network 2

and this is indeed what we do, but instead of networks we use the term domain.

Wiki defines a domain as follows:

A domain name is an identification string that defines a realm of administrative autonomy, authority or control within the Internet.

So now we have

mailserver in Domain 1 and mailserver in Domain 2

This arrangement is much better than the original flat list but again gives us problems as the number of domains increases. The solution is to arrange the domains in a hierarchy.

This takes the form of a tree like structure that resembles the file system structure found on computers.

On your computer the top of your file system is usually c:\ (windows) or / (linux).

On a file system the files are placed in folders or directories, and the directories can contain other directories.

In the Domain Name structure computer IP address mappings (equivalent to files) are placed in domains, and these domains can contain other domains (sub domains).

The root of the structure is a dot (.).

click for larger imagedomain-name-structure-compare

In the file system naming is done from the root down, but in the domain name system it is done from the bottom to the root.

So we have C:\folder\subfolder\file for the filesystem path, and computername.subdomain.domain. for DNS.

In the file ssytem structure a \ or / is used as the separator, wheres in DNS a dot is used.

Underneath the top level dot (root) are what are known as the top level domains (TLDs) which are strictly controlled (e.g..com, .net, .UK).

The original Domain name structure didn’t have country specific TLDs.

These country specific TLDs were added later when the Internet became International.

Underneath the top level domains are second level domains like IBM,Microsoft and Juice in our example below.

This second level name is typically the name of an organisation, and control over this name is given to that organisation.domain-name-structure-dns

The organisation can then divide the domain into third level domains as it wishes.

At any level a domain can contain sub domains or computer name to address  mappings  (i.e. www).

What is WWW?

You may have noticed that most websites have a web address of the form www.domainname.com.

The www name is the name of the web server, and it is a convention on the internet so as to make it easier for you to remember Web addresses.

Summary

Because people remember names easier than numbers computers names are used instead of numbers (IP addresses).

Originally this mapping was done manually and then using a simple text file on the computer but as networks and network sizes increased there was a need for a better way of organising these name to IP address mappings.

The resulted in the development of the Domain name Structure and the Domain Name System.



Related Tutorials and resources:

Save

Save

Save

Please rate? And use Comments to let me know more

6 comments

  1. Hi I’ve got an apache2 server should I create a DNS hostnames list with my router IP number or would you recommend a IP number for each, I saw earlier after installing that it will have its own unique numbers after the routers IP number allocated which I’m manually entering into the DNS, if I had a DNS client on a device does the client have a way to say to a client a extension number of IP is already taken and a hostname aswell,? I after saying this do think I need a client to be able to try it and see I after reading your post understand alot more now than I did previously I saw that these host use my PC to find them other bits of information which makes me think I’m using a router that gives me my connection and I’m able to give others a way to have my PC DNS server do the work remembering their hostname and locating it amount available routers, do they need to have it on their routers or can it be on the device client alike or alone on a PC not Android or other phones.? So that my PC and their router/PC or both or just the PC/Andriod can connect anywhere at WiFi cafe’s coffee shops bars restraunts hospitals etc and be located there as the hostname they select ?
    Saying this I presume then that no apache2 or other server would be on their PC or android telephone and that they then need a description page to be found on their PC or Andriod telephone phone.

    This page then would be stored on their device and depending on their devices use the appropriate ways to enable a page.
    So my PC helps others find them via my router and waits there for updates from the clients to send to the clients at my PC. This is what is happening now by adding a DNS hostname to my router.

    For myself I have my hostname with no -IP should I disconnect them from my router for an IP names hostname on my PC which is the router IP and not a local IP 27.0.0.1 which I only have one of, the name is what I currently registered with no-ip and have on my router. Should I add the extension from my own DNS to the hosts file where these files are located in my Ubuntu raspberry Pi 4 with the router DNS off the router then so my traffic stays in my PC and is not going to no -ip website and sending and receiving from their PC. Will it work if I add the extension to my hostname in the apache2 hosts and update virtual server descriptions with the extensions then, like a client could on their pc if the only had apache2 on the Andriod phone or perhaps some other way to enable a file to be seen via the DNS server alone for supplying information for clients routers to display.

    The way to seperate clients files isn’t DNS but some other server and is the FTP server that can decide that right and works with servers I presume because this I haven’t read into much and would save me storage space on my PC not having device clients items I would prefer to reflect so to say or mirror the stored location to my server and am wondering if a FTP client has a build in DNS server details part or wether it is seperate on the clients PC or device, and if seperate is DNS applicable without a FTP server need earlier it assists to networks in identifying the PC, I’m wondering what would have the names of all such in a business that would require them to be contacted or used so to say for the html content or scripts written on their page.
    This would be applicable then mostly I presume for a large number of devices allowed IP numbers from 1 router I’m in doubt about this if it’s in one server and no pages are needed from other devices, perhaps in html the pages all need to be in one place one script may exist do you know what it is to use a page that’s external and not in the folder for html files? I know I can use an iframe to view other webpages from anywhere with their permissions, and all the above is irrelevant the DNS server can assist hostnames to make use of 8.8.8.8 8.8.4.4 but if I want to make it my own unique one how do I set mine to be from my PC IP ?
    Which uses Google ones on its router from the DNS I used or should I remove it from my router for each hostname?

  2. I get the point of a DNS server it’s brilliant now I don’t need numbers only letters that’s works well it seems but I’m in a issue personal my router is not static I narrowed down the range of IP numbers it can allocate and have one sometimes two IP numbers ,for my phone and my PC,which is on the eth0 connection.

    I recently installed apache2 and created hosts and they 27.0.0.1 here I am in need of help I saw internet posts that have IP numbers instead of the 27.0.0.1 which I found on a internet site that said it’s a local file location so all can go like that and the name used will relate to the html folder file per host name to use the browser to access the html page .

    Virtual servers were created for each and added to the router to allow http access and added to ufw firewall, I then added mod security firewall for Apache with basic rules in place, these hosts of mine are they static names per html folder? In other words is it only just ready for a DNS server or are they ok as they are and I’ve no need for a DNS server ?

    To make matters worse, I only registered one of my hosts with no IP and added the settings to my router, this is a bit bogling for me, do I do that for every new host and just so that the local IP of mine is found with the host/hosts name/s in my PC now? If I didn’t I presume that the html page would have still loaded by the name allocated to it on my apache2 hosts / server serving them hey?

  3. “A domain name is an identification string that defines a realm of administrative autonomy, authority or control within the Internet.”—wiki definition of a domain.

    “…and this is indeed what we do, but instead of networks we use the term domain.” steve’s explanation/definition of a domain.

    Thanks for keeping it simple.

  4. I am a young programmer (15 years old) and needed a better grasp of the DNS system and cant afford courses, thanks for the help, its like having a professional teacher for free!

Leave a Reply

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