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,505 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 71

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Synchronize a new Active Directory domain with an existing Office 365 tenant
A procedure for exporting installed hotfix details of remote computers using powershell
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scannerā€¦
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the adminiā€¦

679 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