Using PowerShell to create a split DNS zone

I ran across a great blog article on setting up a split DNS (Domain Name System) zone this morning.   It got me to thinking though, can I do this in PowerShell?  The answer is yes.  And it is quicker than using the DNS management console.  Change the zone name and IP address to match the name and server IP respectively.

  1. Add-DnsServerPrimaryZone <test.mydomain.com> -ReplicationScope “Forest”
  2. Add-DnsServerResourceRecord -A -Name “.” -ZoneName <test.mydomain.com> -IPv4Address <99.99.99.99>

 

If you have a way of doing this command in one line I want to hear about it.  Post it in the comments below.

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s