6.0

Table Of Contents
VMware, Inc. 129
Chapter 9 Managing vSphere Networking
InnetworkenvironmentswhereaDHCPserverandaDNSserverareavailable,ESXihostsareautomatically
assignedDNSnames.
InnetworkenvironmentswhereautomaticDNSisnotavailableoryoudonotwanttouseautomaticDNS,you
canconfigurestaticDNSinformation,includingahostname,primarynameserver,
secondarynameserver,
andDNSsuffixes.
Theesxcli network ip dnsnamespaceincludestwonamespaces.
esxcli network ip dns searchincludescommandsforDNSsearchdomainconfiguration.
esxcli network ip dns serverincludescommandsforDNSserverconfiguration.
ThefollowingexampleillustratessettingupaDNSserver.Specifyoneoftheoptionslistedin“Connection
OptionsforvCLIHostManagementCommands”onpage 18inplaceof<conn_options>.
To set up a DNS Server
1PrintalistofDNSserversconfiguredonthesystemintheorderin
whichtheywillbeused.
esxcli <conn_options> network ip dns server list
IfDNSisnotsetupforthetargetserver,thecommandreturnsanemptystring.
2Addaserverbyrunningesxcli network ip dns server addandspecifyingtheserverIPv4address
orIPv6address.
esxcli <conn_options> network ip dns server add --server=<str>
3 Changethesettingswithesxcli network ip dns.
SpecifytheDNSserverusingthe--dnsoptionandtheDNShost.
esxcli <conn_options> network ip dns server add --server=<server>
RunthecommandmultipletimestospecifymultipleDNShosts.
ConfiguretheDNShostnamefortheserverspecifiedby--server(or--vihost).
esxcli <conn_options> system hostname set --host=<new_host_name>
ConfiguretheDNSdomainnamefortheserverspecifiedby--server(or--vihost).
esxcli <conn_options> system hostname --domain=mydomain.biz
4ToturnonDHCP,enableDHCPandsettheVMkernelNIC.
TurnonDHCPforIPv4
esxcli <conn_options> network ip interface ipv4 set --type dhcp/none/static
esxcli <conn_options> network ip interface ipv4 set --peer-dns=<str>
TurnonDHCPforIPv6
esxcli <conn_options> network ip interface ipv6 set --enable-dhcpv6=true/false
esxcli <conn_options> network ip interface ipv6 set --peer-dns=<str>
To modify DNS setup for a preconfigured server
1DisplayDNSpropertiesforthespecifiedserverasfollows:
Listthehostanddomainname.
esxcli <conn_options> system hostname get
ListavailableDNSservers
esxcli <conn_options> network ip dns server list
ListtheDHCPsettingsforindividualVMkernelNICs.
esxcli <conn_options> network ip interface ipv4 get
esxcli <conn_options> network ip interface ipv6 get