2012-03-21 60 views
0

我一直以为域名是以某种方式相关的一系列机器。当我ping一个域名(如google.com)时,如何返回一个IP地址?这个IP指的是什么?Ping命令和域名

回答

0

引述centos.org BIND documentation

Zone File Resource Records 

... 

    A — Address record, which specifies an IP address to assign to a name. 

    <host>  IN  A  <IP-address> 

    Figure 14-7. Sample A record configuration 

    If the <host> value is omitted, then an A record points to a default IP address for the top of the namespace. This system will be the target of all non-FQDN requests. 

    Consider the following A record examples for the domain.com zone file: 

       IN  A  10.0.1.3 
    server1  IN  A  10.0.1.5 

在上文中,10.0.1.3是该域的IP。例如。如果以上是域example.com的区域文件,则ping example.com将会ping 10.0.1.3。每个域都有这个“默认”IP地址,就像上面的情况一样,其他IP也是如此。

请注意,您可以使用相同的DNS名称指定多个IP--这用于负载平衡(请参阅,例如thisthis)。要看到这个,doo nslookup google.com

+0

啊。说得通。谢谢。 – 2012-03-21 02:04:05

0

域名是简单的指向IP地址的人性化指针。

IP地址指的是特定域名所指向的机器的地址。这取决于使用DNS。 为了冗余的原因,一些较大的域名(如google.com)确实拥有多个与其关联的IP地址。由于这些额外的IP地址被假定为返回相同的内容,因此大多数程序(包括ping)都只返回一个任意的内容。如果您想查看所有这些IP地址,则可以使用dig程序。