6.5

Table Of Contents
2 If the DNS properties are set, and you want to change the DHCP seings, you must specify the virtual
network adapter to use when overriding the system DNS.
You can override the existing DHCP seing by using the following commands.
esxcli <conn_options> network ip interface ipv4 set --type dhcp/none/static
esxcli <conn_options> network ip interface ipv6 set --enable-dhcpv6=true/false
Setting the DNS Configuration with vicfg-dns
The vicfg-dns command lists and species the DNS conguration of your ESXi host. You can call the
command without command-specic options to list the existing DNS conguration.
You can also use esxcli network ip dns for DNS management.
I If you try to change the host or domain name or the DNS server on hosts that use DHCP, an
error results.
In network environments where a DHCP server and a DNS server are available, ESXi hosts are
automatically assigned DNS names.
In network environments where automatic DNS is not available or not desirable, you can congure static
DNS information, including a host name, primary name server, secondary name server, and DNS suxes.
Set Up a DNS Server with vicfg-dns
You can use vicfg-dns to set up a DNS server.
The following example illustrates seing up a DNS server. Specify one of the options listed in “Connection
Options for vCLI Host Management Commands,” on page 19 in place of <conn_options>.
Procedure
1 Run vicfg-dns without command-specic options to display DNS properties for the specied server.
vicfg-dns <conn_options>
If DNS is not set up for the target server, the command returns an error.
2
To change the seings, use vicfg-dns with --dns, --domain, or --hostname.
n
Specify the DNS server by using the --dns option and a comma-separated list of hosts, in order of
preference.
vicfg-dns <conn_options --dns <dns1,dns2>
n
Congure the DNS host name for the server specied by --server or --vihost.
vicfg-dns <conn_options> -n dns_host_name
n
Congure the DNS domain name for the server specied by --server or --vihost.
vicfg-dns <conn_options> -d mydomain.biz
3
To turn on DHCP, use the --dhcp option.
vicfg-dns <conn_options> --dhcp yes
Modify DNS Setup for a Preconfigured Server with vicfg-dns
You can use vicfg-dns to modify the setup of a precongured DNS server.
Specify one of the options listed in “Connection Options for vCLI Host Management Commands,” on
page 19 in place of <conn_options>.
Chapter 9 Managing vSphere Networking
VMware, Inc. 151