Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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 = “”
$Container = “”
$RecordClass = $Null
$TTL = $Null
$Preference = 10
$MailServer = “”
$$MXrec.CreateInstanceFromPropertyData($ServerName, $ContainerName,’
$OwnerName, $RecordClass, $TTL, $Preference, $MailServer
share|improve this answer

Your Answer


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.