/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 have over 20 years of experience in the IT industry. I have been working with Virtualization for more than 15 years (mainly VMware). I recently obtained certifications, including VCP DCV 2022, VCAP DCV Design 2023, and VCP Cloud 2023. Additionally, I have VCP6.5-DCV, VMware vSAN Specialist, vExpert vSAN, vExpert NSX, vExpert Cloud Provider for the last two years, and vExpert for the last 7 years and a old MCP. My specialties are Virtualization, Storage, and Virtual Backup. I am a Solutions Architect in the area VMware, Cloud and Backup / Storage. I am employed by ITQ, a VMware partner as a Senior Consultant. I am also a blogger and owner of the blog ProVirtualzone.com and recently book author.

Leave A Comment