The esxcli network ip dns command lists and specifies the DNS configuration of your ESXi host.
The esxcli network ip dns namespace includes two namespaces.
■ esxcli network ip dns search includes commands for DNS search domain configuration.
■ esxcli network ip dns server includes commands for DNS server configuration.The following example illustrates setting up a DNS server. Specify one of the options listed in Connection Options for vCLI Host Management Commands in place of <conn_options>.
2 Add a server by running esxcli network ip dns server add and specifying the server IPv4 address or IPv6 address.
3 Change the settings with esxcli network ip dns.
■ Specify the DNS server using the --dns option and the DNS host.
■
■ The vicfg-dns command lists and specifies the DNS configuration of your ESXi host. Call the command without command-specific options to list the existing DNS configuration. You can also use esxcli network ip dns for DNS management.
The following example illustrates setting up a DNS server. Specify one of the options listed in Connection Options for vCLI Host Management Commands in place of <conn_options>.
1 Run vicfg-dns without command-specific options to display DNS properties for the specified server.
2
■ Specify the DNS server by using the --dns option and a comma-separated list of hosts, in order of preference.
■
■
3 To turn on DHCP, use the --DHCP option.
1 Run vicfg-dns without command-specific options to display DNS properties for the specified server.
2 If the DNS properties are set, and you want to change the DHCP settings, you must specify the virtual network adapter to use when overriding the system DNS. v_nic must be one of the VMkernel network adapters.