I am trying to understand the DNS. Say I have a domain named mydomain.com. And let's say that we have the following FQDNs:











Now my question is, what can I infer given this information?

For example, can I infer that sub00.sub0.mydomain.com sub01.sub0.mydomain.com are geographically located in similar locations? (Because they are under the same subdomain: sub0.mydomain.com). Or is it completely possible that one of them is located in say, US and the other in China?

If not, what can I infer given this list of FQDNs? In other words, what is the purpose of the subdomain system?

Also, if sub00.sub0.mydomain.com points to a computer, is it possible that sub0.mydomain.com points to a computer as well?


Basically, DNS is only a name system. So you have FQDN and they translate into something else. This could be for example an IP address (A record), a mailserver (MX record) or another thing.

Often times, it is used in a way that subdomains provide hierarchy. So sub.domain.com is something belonging to domain.com. But if you want, you can do this mapping in any way you want. There is especially no geographic information in domain names. Nevertheless, it makes sense to use the hierarchy and distribute your name servers in a geographically senseful manner. But you are not forced to do so and many organizations don't do so. Take for example content-delivery networks (CDNs), where they are resolving domains based on your location, so that you get the content from a geographically nearby location to reduce latency and load on the network.

The actual DNS lookup is also done hierarchically:

  • You want to resolve sub.example.com
  • Your local resolver asks the root servers for the address of .com TLD server
  • Your local resolver asks the TLD server for the address of example.com

Up to this point, the domain hierarchy and the name servers are usually mapped 1:1, so one part of the domain relates to one name server. Starting from the domain, it can then have an arbitrary structure and is due to the organizations needs. So one server could be responsible for sub.sub.sub.domain.com or there can be 3 servers responsible for this.

| improve this answer | |
  • Could you further explain the last part: "Up to this point, the domain hierarchy and the name servers are usually mapped 1:1. Starting from the domain, it can then have an arbitrary structure and is due to the organizations needs." – Utku Nov 5 '15 at 8:00
  • I changed my answer and tried to be a bit more precise. – Darneas Nov 5 '15 at 8:03
  • So given the sub1.mydomain.com, sub10.sub1.mydomain.com and sub100.sub10.sub1.mydomain.com, what is the relation between them? Are they related in any way? – Utku Nov 5 '15 at 8:08
  • They have coincidentially the same suffix and the DNS resolution path overlaps. – Darneas Nov 5 '15 at 8:12
  • And that's it right? They don't have any other restrictions/requirements? Meaning: They can be on different (sub) networks, they can have totally unrelated content etc. etc. – Utku Nov 5 '15 at 8:13

The main answer to you question is that the domain and subdomain system helps to scale the administration of computer names that map to a certain IP.

DNS only maps a domain name to an IP. If you want to communicate with mydomain.com then your computer needs the IP of the server where that domain is hosted, since computers communicate and are identified based on IP addresses (and MAC on layer 2).

When trying to establish a connection to mydomain.com, your computer will make a query to the DNS system to send him the IP of the machine associated with that domain. Note that multiple domains can be mapped to the same IP.

The same happens when you communicate with a subdomain like sub10.sub1.mydomain.com. What you can infer from domains with a common suffix is that it may be possible that they are under the same administration and the hosts associated with them are also under the same administration.

| improve this answer | |
  • DNS can be used for way more than just mapping "a domain name to an IP". That may be its primary use, but it's a long way from its "only" use. – Alnitak Nov 6 '15 at 23:23

OK, so think of DNS as an upside-down tree, a directory structure if you will. Working backward, from the end of the FQDN... At the end of every Fully-Qualified Domain Name (FQDN) is an implied (or literal) "dot". This ending "dot" is root. Next is either a Top-Level Domain (TLD) or a Country Code-Level Domain (CCLD). So if we take an example, host.mydomain.com is really "host.mydomain.com**.**" where: .= root, .com = TLD, .mydomain = domain level, host = name of host.

Without going into the details and semantics of DNS queries (like authoritative or non-authoritative, or recursive vs. non-recursive), when your device queries for this host (or subdomain or domain), it first asks "root" where to find "com", then asks "com" where to find "mydomain", and then asks "mydomain" where to find "host". Best Practice is to never use "dots" in hostnames. Some don't follow best practice. With your list above, if they use dotted hostnames, everything past that 2nd-level domain is thrown out with the bathwater. Presuming that they've followed Best Practice and the "dots" truly do indicate a domain hierarchy, then you can infer the following tree (not great art): domaincells

Remember that DNS is a Name Service and has no bearing what-so-ever on the layout of the actual physical network. If I am the NameServer that "owns" (is authoritative for) the "sub00.sub0.mydomain.com" domain, then I will have the authoritative answer for the host called "sub000". Ask me, and I will tell you its IP. That IP (or any name that I am authoritative for) can be in NE, GA, Singapore, or anywhere else in the world. Now while its true that I can be authoritative for a name that is anywhere in the world, I am likely responsible for hostnames/IPs that are near me, either in proximity or by some other relationship (like within the same company or division in a company).

| improve this answer | |

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