Configure DNS and Routing on an ESXi host

Configure IP addresses are configured under a VMkernel interface (Host -> Manage -> Networking -> VMkernel adapters):


DNS and default gateway are globally configured under Host -> Manage -> Networking -> TCP/IP configuration:


Using CLI:

export VI_SERVER=
export VI_USERNAME=EXAMPLE\\Administrator
export VI_PASSWORD=Password
$ vicfg-vmknic -h -i -n "Management Network"
$ vicfg-vmknic -h -l
Interface  Port Group/DVPort             IP Family IP Address                        Netmask           MAC Address       MTU     Type        VMotion
vmk0       Management Network            IPv4               00:1b:78:b8:13:fc 1500    STATIC      Not Available
vmk0       Management Network            IPv6      fe80::21b:78ff:feb8:13fc          64                00:1b:78:b8:13:fc 1500    STATIC      Not Available
$ esxcli -h system hostname set --host esxi1 --domain
$ vicfg-dns -h --dns
$ vicfg-route -h -a default

Using Host Profiles:

  • VMkernel IP address: Networking configuration -> Management Network -> IP address settings: ip_on_profiles
  • Hostname, domain and DNS: Networking configuration -> NetStack Instance -> DNS configuration: dns_on_profiles
  • Default gateway and static routes: Networking configuration -> NetStack Instance -> IP route configuration: routes_on_profiles