vicfg-dns - configure DNS properties


 vicfg-dns <conn_options>
     [--dhcp [yes|no] |
      --dns <server_list> |  
      --domain <domain_name> |
      --help |
      --hostname <dns_host> |
      --vnic <virtual_nic> |
      --refresh |
      --vihost <esx_host> ]

To list the existing DNS configuration, call the command without options.


The vicfg-dns command lists and specifies the DNS configuration of your ESX/ESXi host. Call the command without command-specific options to list the existing DNS configuration.

If you attempt to change the host name, domain name, or DNS server on hosts that use DHCP (dynamic host configuration protocol), an error results.



Specifies the target server and authentication information if required. Run vicfg-dns --help for a list of all connection options.

--dhcp | -H [yes|no]

Specifies whether or not the ESX/ESXi host should use DHCP to determine the DNS configuration automatically. If you use this option, you must specify yes or no.

--dns | -D <server_list>

DNS server or servers to be used. Specify a comma-separated list of DNS servers, in order of preference. For vSphere 4.0 and later, IPv6 addresses are valid.

--domain | -d <domain_name>

The domain name portion of the DNS name. For example,


Prints a help message for each command-specific and each connection option. Calling the script with no arguments or with --help has the same effect.

--hostname | -n <dns_host>

Human-readable host name portion of the DNS name. For example, esx01.

--vnic | -V <virtual_nic>

The virtual network adapter to use in overriding the system DNS. This option is required when --dhcp is yes. For ESX systems, <virtual_nic> must be one of the Service Console network adapters. For ESXi, <virtual_nic> must be one of the VMkernel network adapters. The specified virtual network adapter must have DHCP configured.

--refresh | -r

Refresh the network system.

--vihost | -h <esx_host>

When you execute a vSphere CLI with the --server option pointing to a vCenter Server system, use --vihost to specify the ESX/ESXi host to run the command against.


The following examples assume you are specifying connection options. Run vicfg-dns --help for a list of common options including connection options.

Display DNS properties for the specified server. The information includes the host name, domain name, DHCP setting (true or false) and DNS servers on the ESX/ESXi host:

 vicfg-dns <conn_options>

Configure the DNS host name property:

 vicfg-dns <conn_options> -n <host name>

Configure the DNS domain name property:

 vicfg-dns <conn_options> -d <domain name>

Specify that the host should use DHCP to determine the DNS configuration:

 vicfg-dns <conn_options> --dhcp yes --vnic <virtual_nic>

Disable DHCP:

 vicfg-dns <conn_options> --dhcp no