网络设备主机名是由设备本身还是由网络管理员确定的?

Izz*_*zzo 5 dhcp hostname static-ip-address

I have a local network with several PCs and specialized controllers on it. These specialized controllers must be configured with static IP addresses and do not have DHCP capabilities.

I was asked to put together a list of the device hostnames and IP addresses. It's easy to figure out the IP address of each device, however, I'm struggling to find out the host name for these specialized controllers. If it were a Windows PC, I would simply navigate some menus to find the host name.

I'm confused about how the host name is configured for network devices in general. For Windows PCs, it seems like the PC itself determines its own host name. When it joins a network, it simply broadcasts its host name to a DNS server and the DNS server remembers it. For devices that are not DHCP, it seems like I would need to manually go to a DNS server and enter the host name for the specific IP address.

So what exaclty determines the host name? The device itself or a network admin?

tuk*_*kan 3

这更多的是网络问题,属于 ServerFault - 你会在那里更快地得到答案。

如果是 Windows PC,我只需浏览一些菜单即可找到主机名。

如果没有Windows,那还叫什么系统呢?Linux、*BSD、AIX 还是其他?我现在就Linux 来回答。

那么到底是什么决定了主机名呢?设备本身还是网络管理员?

这取决于您在 Linux 检查中的配置 -/etc/nsswitch.conf 例如

hosts:          files dns
Run Code Online (Sandbox Code Playgroud)

它定义了主机名将被定义/etc/hosts,如果在那里找不到它,它将检查DNS下一步。

如果hosts文件(本地解析)包含它所使用的 ip <-> 名称对。如果 DNS 优先并且它包含从那里获取的对。如上所示,它可以按定义的顺序同时包含两者,然后按该顺序完成解析。

顺便说一句,DHCP 服务器可以根据您的 MAC 地址为您提供静态 IP 地址,因此如果使用相同的网卡,您的控制器将始终具有相同的 IP 地址。管理比手动配置所有服务器更容易。