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.
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.
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.
Leave A Comment
You must be logged in to post a comment.