How The Internet Really Works

The times they are a-changin’.

This post seems to be older than 15 years—a long time on the internet. It might be outdated.

There is a big difference between how the common user percieves how the Internet works and how it actually works. This is something I’ve been learning over the past week and it really makes me hate and appreciate the Internet more now. Let’s say you go to my website, https://www.andrewferguson.net. The first thing your browser does is check with the local Domain Name Server server. DNS servers are responsible for maintaining a listing of websites and where they point to. The DNS server will do one of four things:

  1. It can answer the request with an IP address because it already knows the IP address for the requested domain.
  2. It can contact another DNS server and try to find the IP address for the name requested. It may have to do this multiple times.
  3. It can say, "I don’t know the IP address for the domain you requested, but here’s the IP address for a DNS server that knows more than I do."
  4. It can return an error message because the requested domain name is invalid or does not exist.

Herein lies the key to why the Internet is a crazy place. Everything has to be specified. There are 9 types of records: A, AAAA/IPv6, SOA, MX, NS, rDNS, CNAME, PTR, and TXT. Here is the DNS record for this website:

andrewferguson.net. 86400 IN SOA ns0.xname.org. andrew.fergcorp.com. 2004102505 10800 3600 604800 10800
andrewferguson.net. 86400 IN NS ns0.xname.org.
andrewferguson.net. 86400 IN NS ns1.xname.org.
andrewferguson.net. 86400 IN A 70.56.95.233
www.andrewferguson.net. 86400 IN A 70.56.95.233
andrewferguson.net. 86400 IN SOA ns0.xname.org. andrew.fergcorp.com. 2004102505 10800 3600 604800 10800

The first line says that for andrewferguson.net, ns0.xname.org is the Start of Authority (that is ns0.xname.org has the official responsibillity to know where andrewferguson.net is located at all times).

2004102505 is the date this record was last updated: October 25, 2004, 5th version of the day. The next string of numbers are just timeout numbers and are not that important.

andrewferguson.net. 86400 IN NS ns0.xname.org. and andrewferguson.net. 86400 IN NS ns1.xname.org. basically says that ns(0/1).xname.org is a Name Server for my website.

andrewferguson.net. 86400 IN A 70.56.95.233 and www.andrewferguson.net. 86400 IN A 70.56.95.233 tells the DNS the actual physical location of my website. Note that both the qualified name and the www subzone are both listed. This is the actual information that the DNS server sends back to you, the user. Then your browser initiates a connection with 70.56.95.233 and you arrive at my website.

For fergcorp.com, the records look pretty similar. The one notible difference is the addition of:

fergcorp.com. 86400 IN MX 5 mail.fergcorp.com.

This says that for the domain fergcorp.com, all mail should be sent to the server named mail.fergcorp.com. The 5 indicates that this is the first mailserver that should be contacted.

That’s a lot of stuff to figure out. Thus far, I’ve covered A, SOA, MX, and NS. I don’t use AAAA/IPv6, CNAME, TXT, or PTR. The rDNS basically is the reverse of the DNS lookup. It takes an IP address and gets an address back. Reversing my IP address will always return fergcorp.com, it’s just the way it’s setup.

0