Over the past few months I’ve been doing a lot of work with VMware Horizon 6. I’m not going to go into details, as VMware has done a great job doing that, plus I’m under a NDA. Suffice to say, details that have been provided suffice if you’re just looking for info.
In my company sponsored lab environment, I have HWS 1.8 deployed in feature/option parity compared to production. Deploying a second instance of HWS (perhaps a pre-release version), is challenging, due to DNS/Reverse DNS Checks that are done.
Anyways – the reason you’re probably here is to find out how to systematically modify DNS records, so here ya go!
To create the A Record Test-A-Record with IP 192.168.100.100 to DNS Server corp-dns-1 in zone corp.internal, use the following command:
1 |
Add-DnsServerResourceRecordA -Name Test-A-Record -IPv4Address 192.168.100.100 -ZoneName corp.internal -ComputerName corp-dns-1 |
To remove the same record, run the following command:
1 |
Remove-DnsServerResourceRecord -ZoneName corp.internal -ComputerName corp-dns-1 -Name Test-A-Record -RRType "A" |
So, in order to switch between environments, you can use the following snippets:
Switch From Original state to Alternate Environment:
1 2 3 4 |
Add-DnsServerResourceRecordA -ZoneName corp.internal -ComputerName corp-dns-1 -Name configurator-va -IPv4Address [configurator-ip-address] Add-DnsServerResourceRecordA -ZoneName corp.internal -ComputerName corp-dns-1 -Name service-va -IPv4Address [service-ip-address] Add-DnsServerResourceRecordA -ZoneName corp.internal -ComputerName corp-dns-1 -Name connector-va -IPv4Address [connector-ip-address] Add-DnsServerResourceRecordA -ZoneName corp.internal -ComputerName corp-dns-1 -Name gateway-va -IPv4Address [gateway-ip-address] |
Revert Back to original state:
1 2 3 4 5 6 7 8 9 |
Remove-DnsServerResourceRecord -ZoneName corp.internal -ComputerName corp-dns-1 -RRType "A" -Name configurator-va Remove-DnsServerResourceRecord -ZoneName corp.internal -ComputerName corp-dns-1 -RRType "A" -Name service-va Remove-DnsServerResourceRecord -ZoneName corp.internal -ComputerName corp-dns-1 -RRType "A" -Name connector-va Remove-DnsServerResourceRecord -ZoneName corp.internal -ComputerName corp-dns-1 -RRType "A" -Name gateway-va Add-DnsServerResourceRecordA -ZoneName corp.internal -ComputerName corp-dns-1 -Name configurator-va -IPv4Address 10.69.0.110 Add-DnsServerResourceRecordA -ZoneName corp.internal -ComputerName corp-dns-1 -Name service-va -IPv4Address 10.69.0.111 Add-DnsServerResourceRecordA -ZoneName corp.internal -ComputerName corp-dns-1 -Name connector-va -IPv4Address 10.69.0.113 Add-DnsServerResourceRecordA -ZoneName corp.internal -ComputerName corp-dns-1 -Name gateway-va -IPv4Address 10.69.0.117 |
Hope this helps!
Source: MS Technet