Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Is there a way to set some default MX records that are added to any new forward zone that is created within the DNS manager in Windows 2008 Standard?

If not is there a command line I can run to add the MX records to a specific, existing forward zone?

That way I could just create a zone, create my A and CNAME records manually, then run a script to set MX records.

share|improve this question
add comment

1 Answer

You can't set default MX records, but you can script them.

You can use Powershell to add a DNS record. Here's a sample for MX:

$mxRec = [WMIClass]“\\$ServerName\root\MicrosoftDNS:MicrosoftDNS_MXType”
$Server = “NyDNSServer”
$Owner = “mydomain.com”
$Container = “mydomain.com”
$RecordClass = $Null
$TTL = $Null
$Preference = 10
$MailServer = “mail.mydomain.com”
$$MXrec.CreateInstanceFromPropertyData($ServerName, $ContainerName,’
$OwnerName, $RecordClass, $TTL, $Preference, $MailServer
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.