[Home] [Forum] [3i RCLI Guide]
The commands vicfg-dns.pl (esxcfg-dns.pl) are used to set the host and domain names for your ESXi server. These options can be statically set, or you can configure the ESXi host to obtain both the host name and domain name from a DHCP server.
The command has the below options.
--hostname <host_name> (-n <hostname>) - Specify the hostname for your ESXi server.
--domain <domain_name> (-d <domain_name>) - Set the domain name for your host.
--dns <dns_server1[,dns_server2..]> (-D <dns_server1[,dns_server2..]>) - Set the primary and secondary DNS servers for your host.
--dhcp < yes | no > (-H < yes | no >) - This option will instruction the host to get it's DNS servers from a DHCP server. The below option must also be configured for this to work.
--vnic <vmnicX> (-V <vmnicX) - Used with the --dhcp option, this option will specify which NIC adaptec to use to get DNS override configuration.
Notes
1) Running the command with none of the above options will show the current DNS configuration
2) If specifying mulitple DNS servers, ensure that there are no spaces between the commas and DNS IP / hostnames
Sample Session
vicfg-dns.pl --server 192.168.1.20 --hostname ESX09
Updated Host DNS network configuration successfully.
vicfg-dns.pl --server 192.168.1.20 --domain MISHCHENKO.NET
Updated Host DNS network configuration successfully.
vicfg-dns.pl --server 192.168.1.20 --dhcp yes
Must specify a vnic adapter that is configured with DHCP.
vicfg-dns.pl --server 192.168.1.20 --vnic vmnic1
DNS Configuration
Host Name ESX09
Domain Name MISHCHENKO.NET
DHCP true
DNS Servers
vicfg-dns.pl --server 192.168.1.20 --dhcp no
Updated Host DNS network configuration successfully.
vicfg-dns.pl --server 192.168.1.20
DNS Configuration
Host Name ESX09
Domain Name MISHCHENKO.NET
DHCP false
DNS Servers
vicfg-dns.pl --server 192.168.1.20 --dns 192.168.1.5,192.168.1.6
Updated Host DNS network configuration successfully.
vicfg-dns.pl --server 192.168.1.20
DNS Configuration
Host Name ESX09
Domain Name MISHCHENKO.NET
DHCP false
DNS Servers
192.168.1.5
192.168.1.6
These changes can also be made with the VI client.

Copyright © 2009 - Dave Mishchenko