Solved

How do I change the SOA record on a Server 2012 R2 Core box in my DMZ with Powershell?

Posted on 2014-04-17
2
1,411 Views
Last Modified: 2014-04-21
Hello Experts,

How do I change the SOA record on a Server 2012 R2 Core box in my DMZ with Powershell?

I tried doing this with the following dnscmd command:

Dnscmd dmzdns /recordadd mydomain.com . SOA ns1.mydomain.com dns-admin.mydomain.com
0
Comment
Question by:ndalmolin_13
2 Comments
 
LVL 70

Accepted Solution

by:
Chris Dent earned 500 total points
ID: 40008518
2012 R2 comes with DNS CmdLets you know? The syntax is slightly arcane.
Import-Module DnsServer

# Get the record and hold it in two variables (old and new)
$OldSOARecord = $NewSOARecord = Get-DnsServerResourceRecord -ZoneName mydomain.com -RRType SOA
# Set the new values on the New record
# Note that you must include the trailing "." in the string. Tells DNS not to append the origin.
$NewSOARecord.RecordData.PrimaryServer = "ns1.mydomain.com."
$NewSOARecord.ResponsiblePerson = "dns-admin.mydomain.com."
# Commit the changes, referencing the old record, the new record and repeating the domain name.
Set-DnsServerResourceRecord -NewInputObject $NewSOARecord -OldInputObject $OldSOARecord -Zone "mydomain.com"

Open in new window

HTH

Chris
0
 
LVL 1

Author Closing Comment

by:ndalmolin_13
ID: 40012456
Chris,
Thanks for the info and the explaination.  It worked as expected.

Nick
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Set OWA language and time zone in Exchange for individuals, all users or per database.
Create and license users in Office 365 in bulk based on a CSV file. A step-by-step guide with PowerShell script examples.
This video discusses moving either the default database or any database to a new volume.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now