6.0

Table Of Contents
Getting Started with vSphere Command-Line Interfaces
130 VMware, Inc.
2IftheDNSpropertiesareset,andyouwanttochangetheDHCPsettings,youmustspecifythevirtual
networkadaptertousewhenoverridingthesystemDNS.OverridetheexistingDHCPsettingasfollows:
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
Thevicfg-dnscommandlistsandspecifiestheDNSconfigurationofyourESXihost.Callthecommand
withoutcommandspecificoptionstolisttheexistingDNSconfiguration.Youcanalsouseesxcli network
ip dnsforDNSmanagement.
InnetworkenvironmentswhereaDHCPserverandaDNSserverareavailable,ESXihostsare
automatically
assignedDNSnames.
InnetworkenvironmentswhereautomaticDNSisnotavailableornotdesirable,youcanconfigurestaticDNS
information,includingahostname,primarynameserver,secondarynameserver,andDNSsuffixes.
ThefollowingexampleillustratessettingupaDNSserver.Specifyoneoftheoptionslistedin
“Connection
OptionsforvCLIHostManagementCommands”onpage 18inplaceof<conn_options>.
To set up DNS
1Runvicfg-dnswithoutcommandspecificoptionstodisplayDNSpropertiesforthespecifiedserver.
vicfg-dns <conn_options>
IfDNSisnotsetupforthetargetserver,thecommandreturnsanerror.
2Tochangethesettings,usevicfg-dnswith--dns,--domain,or--hostname.
SpecifytheDNSserverbyusingthe--dnsoptionandacommaseparatedlistofhosts,inorderof
preference.
vicfg-dns <conn_options --dns <dns1,dns2>
ConfiguretheDNShostnamefortheserverspecifiedby--server(or--vihost).
vicfg-dns <conn_options> -n dns_host_name
ConfiguretheDNSdomainnamefortheserverspecifiedby--server(or--vihost).
vicfg-dns <conn_options> -d mydomain.biz
3ToturnonDHCP,usethe--DHCPoption.
vicfg-dns <conn_options> --dhcp yes
To modify DNS setup for a preconfigured server
1Runvicfg-dnswithoutcommandspecificoptionstodisplayDNSpropertiesforthespecifiedserver.
vicfg-dns <conn_options>
Theinformationincludesthehostname,domainname,DHCPsetting(trueorfalse),andDNSserverson
theESXihost.
2IftheDNSpropertiesareset,andyouwanttochangetheDHCPsettings,youmustspecifythevirtual
networkadaptertousewhenoverridingthesystemDNS.v_nicmustbe
oneoftheVMkernelnetwork
adapters.
OverridetheexistingDHCPsettingasfollows:
vicfg-dns <conn_options> --dhcp yes --v_nic <vnic>
IMPORTANTIfyoutrytochangethehostordomainnameortheDNSserveronhoststhatuseDHCP,anerror
results.