Dns.GetHostEntry返回多个IP地址 [英] Dns.GetHostEntry returns multiple IP addresses

查看:543
本文介绍了Dns.GetHostEntry返回多个IP地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此问题可能突出了缺乏网络在我的部分校长,而不是编程问题的认识。

This question probably highlights a lack of understanding of networking principals on my part, rather than a programming issue.

我在使用主机名做一个查找

I'm doing a lookup on a hostname using

Dns.GetHostEntry

这将返回一个IPHostEntry对我来说,它有一个AddressList中财产是ip地址的数组。

This returns an IPHostEntry to me, which has an AddressList property which is an array of IPAddress.

我一直以为之间有1对1的映射主机名和IP,但我发现,在某些情况下,我回去几个ip地址(ES)为同一主机。

I always thought there is a 1 to 1 mapping between hostname and IP, but I'm finding that in some cases I get back several IPAddress(es) for the same host.

这是一个让我吃惊。

其中域名解析的一部分,我不明白?

Which part of domain name resolution do I not understand?

推荐答案

任何系统可以具有多个网络接口和互联网地址,但只能有一个名称。从名字到地址的映射向前将返回所有映射到特定名称的地址。我们用我们的文件服务器要做到这一点,使主机不会有访问文件时遍历网络边界,并在各种网卡分散负载出来。该文件服务器将在我们每一个不同的子网来归,有多个接口卡,每一个不同的子网地址,但相同的名称。校园内的DNS服务器仍然设置了这种方式。此外,您可能必须映射到多个系统,提供负载通过DNS平衡一定程度的名称。

Any system can have multiple network interfaces and internet addresses, yet only have one name. The forward mapping from name to address will return all of the addresses mapped to a particular name. We used to do this with our file servers so that hosts wouldn't have to traverse a network boundary when accessing files and to spread the load out across the various NICs. The file servers would be homed on each of our various subnets, having multiple interface cards, each with a different subnet address, but the same name. The DNS servers on campus are still set up this way. Additionally, you may have a name that maps to more than one system, providing some level of load balancing via DNS.

这篇关于Dns.GetHostEntry返回多个IP地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆