Trying to figure out why nslookup is giving me two different IP addresses

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?

0
задан 13 April 2017 в 15:13
1 ответ

Сначала в общем, многие веб-серверы позволяют использовать один и тот же IP-адрес для разных доменов, что объясняет, почему навигация по IP-адресу часто не выполняется.

Что касается вашего вопроса о разнице между www.ibm.com и ibm.com , это совершенно разные записи. Большинство сайтов указывают на одно и то же место либо записью A с тем же IP-адресом, либо CNAME , которая ссылается на основную запись.

IBM фактически связывает CNAME для записи www.ibm.com следующим образом:

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

Я предлагаю вам поискать онлайн-инструменты dig , чтобы узнать, как правильно опрашивать серверы имен.

Наконец, обратите внимание, что некоторые крупные сайты также будут иметь несколько разных адресов в более сложной настройке, которая может варьироваться географически или по очереди (циклический).

1
ответ дан 4 December 2019 в 16:37

Теги

Похожие вопросы