/How to change DNS in VMware SDDC Manager with API

How to change DNS in VMware SDDC Manager with API

Today I need to change my DNS settings in my homelab, so I need to change the DNS in most of my implementations and on my VCF. In this How to change DNS in VMware SDDC Manager with API, I will explain how to do this quickly with API that will change the DNS in all products inside the VCF(SDDC, vCenter, ESXi hosts, and NSX).

First, connect to your SDDC Manager, then go to the Developer Center option. Then select the API Explorer tab, and in the filter, type DNS.

You now see all the APIs for DNS.

How to change DNS in VMware SDDC Manager with API

First, we must check the existing DNS configuration and copy the JSON.

Select the first option: GET – /v1/system/dns-configuration

In the Response, open DnsConfiguration and DnsServer you should see your SDDC DNS configuration.

You can now copy the DNS JSON code or build your own.

How to change DNS in VMware SDDC Manager with API

Then you select POST, copy the JSON code in the parameter, run the Execute and confirm by clicking Continue.

Note: If you only change the DNS IPs, not adding or removing them, you can use the initial JSON code. If you are adding or removing DNS IPs, then create one new.

I only had one DNS server, so I added a second one. Then I needed to change the JSON Code to this:

Since I only had one DSN and added a second one, I need to set one as Primary and the second as false.

After you execute the JSON code, the SDDC manager will change the DNS settings on the products you have in your SDDC Manager.

You can follow the process in the Tasks.

And that is it. With this easy API process, you can change all the DNS quickly.

Share this article if you think it is worth sharing. If you have any questions or comments, comment here, or contact me on Twitter.

©2023 ProVirtualzone. All Rights Reserved
By | 2023-03-11T19:48:09+01:00 March 11th, 2023|VCF, VMware Posts|0 Comments

About the Author:

I am over 20 years’ experience in the IT industry. Working with Virtualization for more than 10 years (mainly VMware). I am an MCP, VCP6.5-DCV, VMware vSAN Specialist, Veeam Vanguard 2018/2019, vExpert vSAN 2018/2019 and vExpert for the last 4 years. Specialties are Virtualization, Storage, and Virtual Backups. I am working for Elits a Swedish consulting company and allocated to a Swedish multinational networking and telecommunications company as a Teach Lead and acting as a Senior ICT Infrastructure Engineer. I am a blogger and owner of the blog ProVirtualzone.com

Leave A Comment