6

为ESXi设置主机名

 3 years ago
source link: https://wusiyu.me/%e4%b8%baesxi%e8%ae%be%e7%bd%ae%e4%b8%bb%e6%9c%ba%e5%90%8d/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

为ESXi设置主机名

在未经过任何设置的内网安装ESXi后,主机名会显示为localhost.localdomain,这是因为ESXi默认会从DNS获取自己的域名,如果内网的DNS未经过设置,ESXi自然获取不到任何有效的域名。

一种对简单的设置方法,就是直接在网络 – TCP/IP 堆栈 – 默认TCP/IP 堆栈 – 基本 DNS 配置中手动设置:

但总归不太优雅,而且这样设置,这个主机名和域名也没有太多实际意义。更推荐的方法是在内网DNS服务器上设置内网的域名和对应这台机器的主机名,这样设置的主机名在内网中都是可用的,ESXi也会自动获取其主机名和域名。

下面以一台使用dnsmasq作为内网DNS和DHCP服务器的网关为例,一些Linux软路由和类OpenWrt系统的路由器都和这类似。

首先在dnsmasq的配置文件中配置以下内容:

# 设置内网域名
domain=lan

# 自动为/etc/hosts中的短主机名加上域名
expand-hosts

# (如果dnsmasq作为DHCP服务器)为ESXi所在主机绑定固定的IP,MAC地址和IP根据实际情况填写
dhcp-host=xx:xx:xx:xx:xx:xx,192.168.10.11

接着,在/etc/hosts中为ESXi所在主机设置一个主机名,添加:

192.168.10.11    home-dev

接下来就可以通过home-dev或者home-dev.lan访问ESXi主机了,如果ESXi上的显示没有更新,尝试重新设置一下网络端口。


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK