简体   繁体   English

如何通过 SSH 在 VMware ESXi 7 上永久配置 DNS 服务器?

[英]How to permanently configure DNS servers on VMware ESXi 7 via SSH?

I want to change (replace) the default DNS servers (which are 8.8.8.8 and 8.8.4.4 ) on VMware ESXi 7.0u1 (specifically custom ISO for Fujitsu servers downloaded from official VMware servers) via SSH shell. I want to change (replace) the default DNS servers (which are 8.8.8.8 and 8.8.4.4 ) on VMware ESXi 7.0u1 (specifically custom ISO for Fujitsu servers downloaded from official VMware servers) via SSH shell. Actually, I want to use it in %firstboot section of my Kickstart file.实际上,我想在我的 Kickstart 文件的%firstboot部分使用它。

I tried to run the following commands, which work but only until I reboot the server.我尝试运行以下命令,这些命令有效,但仅在我重新启动服务器之前。 Then the DNS servers are reset to the default ones.然后 DNS 服务器重置为默认值。

esxcli network ip dns server remove -a
esxcli network ip dns server add -s "$dns"

Is there anything else I need to run to make the change permanent?我还需要运行其他什么来使更改永久生效吗?

From your SSH connection you should be able to use "dcui" command and modify your DNS without losing your configuration after a reboot.通过您的 SSH 连接,您应该能够使用“dcui”命令并修改您的 DNS,而不会在重新启动后丢失您的配置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM