rManic
Expert
Expert

ESXi 4.1 DNS Configuration

Jump to solution

I want to add  more then two DNS in the ESXi host.but I have only two (preferred and alternate)

can you any one help me on this?

regards

Manic

Regards Manic
0 Kudos
1 Solution

Accepted Solutions
avlieshout
VMware Employee
VMware Employee

You can also use VMware PowerCLI to add multiple DNS servers. From the PowerCLI console:

Get-VMHost <esxhostname> | Get-VMHostNetwork | Set-VMHostNetwork -DnsAddress "x.x.x.x","x.x.x.x","x.x.x.x"

If want to apply this to all ESX hosts, just remove the <esxhostname>:

Get-VMHost | Get-VMHostNetwork | Set-VMHostNetwork -DnsAddress "10.0.0.1","10.0.0.2","10.0.0.3"

Arnim van Lieshout

Now available for pre-order: VMware vSphere PowerCLI Reference: Automating vSphere Administration

Arnim van Lieshout Blogging: http://www.van-lieshout.com Twitter: http://www.twitter.com/avlieshout If you find this information useful, please award points for "correct" or "helpful".

View solution in original post

0 Kudos
6 Replies
schepp
Leadership
Leadership

Unlock the support mode of ESXi / log in with ssh. Edit the file /etc/resolv.conf with a text editor like vi and insert another "nameserver xxx.xxx.xxx.xxx" line above the "search domain.com" line.

Regards

Dave_Mishchenko
Immortal
Immortal

You can use vicfg-dns from the vCLI to set multiple DNS servers.  Not sure it's exactly supported, but it seems to work OK.

C:\Program Files (x86)\VMware\VMware vSphere CLI\bin>vicfg-dns.pl --server esx01
-D 192.168.1.25,192.168.1.20,192.168.1.5,192.168.1.6
Updated Host DNS network configuration successfully.

C:\Program Files (x86)\VMware\VMware vSphere CLI\bin>vicfg-dns.pl --server esx01

DNS Configuration

Host Name      esx01
Domain Name    mishchenko.net
DHCP           false
DNS Servers
               192.168.1.25
               192.168.1.20
               192.168.1.5
               192.168.1.6

rManic
Expert
Expert

Do I need to restart any service?

Regards Manic
0 Kudos
schepp
Leadership
Leadership

If you do it by editing the /etc/resolv.conf you don't need to restart anything. It's used from the moment you save the file.

Don't know for Daves solution.

0 Kudos
avlieshout
VMware Employee
VMware Employee

You can also use VMware PowerCLI to add multiple DNS servers. From the PowerCLI console:

Get-VMHost <esxhostname> | Get-VMHostNetwork | Set-VMHostNetwork -DnsAddress "x.x.x.x","x.x.x.x","x.x.x.x"

If want to apply this to all ESX hosts, just remove the <esxhostname>:

Get-VMHost | Get-VMHostNetwork | Set-VMHostNetwork -DnsAddress "10.0.0.1","10.0.0.2","10.0.0.3"

Arnim van Lieshout

Now available for pre-order: VMware vSphere PowerCLI Reference: Automating vSphere Administration

Arnim van Lieshout Blogging: http://www.van-lieshout.com Twitter: http://www.twitter.com/avlieshout If you find this information useful, please award points for "correct" or "helpful".
0 Kudos
depping
Leadership
Leadership

you could also do the following via the TSM

vim-cmd hostsvc/net/dns_set --ip-addresses=10.0.0.1,10.0.0.2

Works fine here,

Duncan (VCDX)

Available now on Amazon: vSphere 4.1 HA and DRS technical deepdive

0 Kudos