VMware Cloud Community
nicholas1982
Hot Shot
Hot Shot
Jump to solution

Set ESXi DNS Server

Hi All,

I'm pretty new to vRO/vCO and I'm looking to build some workflows to configure ESXi, I managed to figure out hot to set the NTP server and restart the service but struggling to work out how to set DNS server addresses, any help guidance would be appreciated.

Nicholas
1 Solution

Accepted Solutions
LukasWe
Enthusiast
Enthusiast
Jump to solution

Hi,

try this:

var host; // your initialized VcHostSystem object!

var hostDnsConfig = host.config.network.dnsConfig; // get current config


// TODO: change hostDnsConfig to your needs -> e.g. hostDnsConfig.address[]


host.configManager.networkSystem.updateDnsConfig(hostDnsConfig);

Regards,

Lukas

View solution in original post

Reply
0 Kudos
2 Replies
LukasWe
Enthusiast
Enthusiast
Jump to solution

Hi,

try this:

var host; // your initialized VcHostSystem object!

var hostDnsConfig = host.config.network.dnsConfig; // get current config


// TODO: change hostDnsConfig to your needs -> e.g. hostDnsConfig.address[]


host.configManager.networkSystem.updateDnsConfig(hostDnsConfig);

Regards,

Lukas

Reply
0 Kudos
nicholas1982
Hot Shot
Hot Shot
Jump to solution

Thank you, this worked, I actually it 95%, my issue was the address was not set to string/array.

Nicholas