0

I'm pretty new to the world of computer science and ran into something that I'm having trouble understanding:

I have this homework assignment asking me to list the IP address produced by using the nslookup command for certain domains. The actual assignment is super easy, but while I was doing it, I realized that when I type "nslookup www.ibm.com" I get a different IP address that when I type "nslookup ibm.com" When I navigated to those IP addresses in Chrome, the "ibm.com" took me straight to the IBM website while the "www.ibm.com" IP address told me it was an invalid URL.

My results from "nslookup www.ibm.com" were:

Non-authoritative answer:
Name:    e2874.x.akamaiedge.net
Address:  104.126.119.173
Aliases:  www.ibm.com
          www.ibm.com.cs186.net
          www.ibm.com.edgekey.net
          www.ibm.com.edgekey.net.globalredir.akadns.net

The results from "nslookup ibm.com" were:

Non-authoritative answer:
Name:    ibm.com
Address:  129.42.38.1

According to whois, the IP address I got with "nslookup www.ibm.com" is a Polish server belonging to Akamai. (Wikipedia says they provide cloud services. IBM is listed as a customer, so I'm pretty sure this isn't exactly a startling discovery.)

What I'm trying to understand is why "nslookup www.ibm.com" and "nslookup ibm.com" produce different IP addresses. I asked on /r/askcomputerscience and was informed that from a DNS perspective, the "www" part doesn't mean a whole lot.

There is also this similar question here on Server Fault, but the answer seems like it might be specific to Google. The question was "Why do nslookup result differ when adding www?" and the answer was "Because google has different DNS records for the root zone and the www zone." Does this answer apply here as well? If so, why have different records for the root zone and the www zone?

1

First of all, many web servers allow the same IP to be used for different domains, which explains why navigating by IP will often fail.

As for your question on the difference between www.ibm.com and ibm.com, they are completely different entries. Most sites point both to the same place either with an A record with the same IP or a CNAME that refers to the main record.

IBM actually chains CNAMEs for its www.ibm.com record as follows:

www.ibm.com.            3600    IN      CNAME   www.ibm.com.cs186.net.
www.ibm.com.cs186.net.  60      IN      CNAME   www.ibm.com.edgekey.net.
www.ibm.com.edgekey.net. 3968   IN      CNAME   www.ibm.com.edgekey.net.globalredir.akadns.net.
www.ibm.com.edgekey.net.globalredir.akadns.net. 3600 IN CNAME e2874.x.akamaiedge.net.
e2874.x.akamaiedge.net. 20      IN      A       172.230.214.78

I suggest you look for online dig tools to learn how to properly interrogate the name servers.

Finally, note that some big sites will also have multiple different addresses in a more sophisticated setup which could vary geographically or in rotation (round-robin).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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