DNSCMD Reference

Fellow Directory Services MVP Mark Minasi has a great table that shows a ton DNS commands using dnscmd. For those of you getting ready to use Server Core here is yet another list of commands that will come in handy. All I can say is WOW!!!


DNSCMD option



Do any dnscmd command on a remote system

dnscmd servername command

dnscmd main.bigfirm.com /zoneprint bigfirm.com


Create a primary zone

dnscmd /zoneadd zonename /primary

dnscmd /zoneadd bigfirm.com /primary


Create a secondary zone

dnscmd /zoneadd zonename /secondary master IP address

dnscmd /zoneadd bigfirm.com /secondary


Host a zone on a server based on an existing (perhaps restored) zone file

dnscmd /zoneadd zonename /primary /file filename /load

dnscmd /zoneadd bigfirm.com /primary /file bigfirm.com.dns /load


Delete a zone from a server

dnscmd /zonedelete zonename [/f]

dnscmd /zonedelete bigfirm.com /f

(without the /f, dnscmd asks you if you really want to delete the zone)

Show all of the zones on a DNS server

dnscmd /enumzones

dnscmd /enumzones


Dump (almost) all of the records in a zone

dnscmd /zoneprint zonename

dnscmd /zoneprint bigfirm.com

Doesn”t show glue records.

Add an A record to a zone

dnscmd /recordadd zonename hostname A ipaddress

dnscmd /recordadd bigfirm.com mypc A


Add an NS record to a zone

dnscmd /recordadd zonename @ NS servername

dnscmd /recordadd bigfirm.com @ dns3.bigfirm.com


Delegate a new child domain, naming its first DNS server

dnscmd /recordadd zonename childname NS dnsservername

dnscmd /recordadd bigfirm.com test NS main.bigfirm.com

This would create the “test.bigfirm.com” DNS child domain unter the bigfirm.com DNS domain

Add an MX record to a zone

dnscmd /recordadd zonename @ MX priority servername

dnscmd /recordadd bigfirm.com @ MX 10 mail.bigfirm.com


Add a PTR record to a reverse lookup zone

dnscmd /recordadd zonename lowIP PTR FQDN

dnscmd /recordadd 1.168.192.in-addr.arpa 3 PTR pc1.bigfirm.com

This is the PTR record for a system with IP address

Modify a zone”s SOA record

dnscmd /recordadd zonename @ SOA primaryDNSservername responsibleemailipaddress serialnumber refreshinterval retryinterval expireinterval defaultTTL

dnscmd /recordadd bigfirm.com @ SOA winserver.bigfirm.com mark.bigfirm.com 41 1800 60 2592000 7200

Ignores the serial number if it”s not greater than the current serial number

Delete a resource record

dnscmd /recorddelete zonename recordinfo [/f]

dnscmd /recorddelete bigfirm.com @ NS main.bigfirm.com /f

Again, “/f” means “don”t annoy me with a confirmation request, just do it.”

Create a resource record and incorporate a nonstandard TTL

dnscmd /recordadd zonename leftmostpartofrecord TTL restofrecord

dnscmd /recordadd bigfirm.com pc34 3200 A


Reload a zone from its zone file in windowssystem32dns

dnscmd /zonereload zonename

dnscmd /zonereload bigfirm.com

Really only useful on primary DNS servers

Force DNS server to flush DNS data to zone file

dnscmd /zonewriteback zonename

dnscmd /zonewriteback bigfirm.com


Tell a primary whom to allow zone transfers to

dnscmd /zoneresetsecondaries zonename /nonsecure|securens

dnscmd /zoneresetsecondaries bigfirm.com /nonsecure

That example says to allow anyone who asks to get a zone transfer

Enable/disable DNS NOTIFY

dnscmd /zoneresetsecondaries zonename /notify|/nonotify

dnscmd /zoneresetsecondaries bigfirm.com /nonotify

Example disables DNS notification, which is contrary to the default settings.

Tell a secondary DNS server to request any updates from the primary

dnscmd /zonerefresh zonename

dnscmd /zonerefresh bigfirm.com


Enable or disable dynamic DNS on a zone

dnscmd /config zonename /allowupdate 1|0

1 enables, 0 disables, 0 is default


Stop the DNS service

Either net stop dns or sc stop dns


(No dnscmd command for this)

Start the DNS service

Either net start dns or sc start dns


(No dnscmd command for this)

Install the DNS service on a 2008 full install system

servermanagercmd -install dns



Install the DNS service on a 2008 Server Core system

ocsetup DNS-Server-Core-Role


Case matters — ocsetup dns-server-core-role would fail

Uninstall the DNS service on a 2008 Server full install system

servermanagercmd -remove dns



Uninstall the DNS service on a 2008 Server Core system

ocsetup /uninstall DNS-Server-Core-Role




  1. Eric Paulson says:

    The PTR Record example here isn”t right. The Record type listed is “a”. As in:
    dnscmd /recordadd 1.168.192.in-addr.arpa 3 A pc1.bigfirm.com

    I believe it should be:
    dnscmd /recordadd 1.168.192.in-addr.arpa 3 PTR pc1.bigfirm.com

    Thanks for the help!

  2. annonymous says:

    Thanks for this page, very helpful!

    just wanted to point out with this PTR example that if you want to have the ip of the hostname explicitly set with the PTR record, you will need to put a “.” at the end of the zone name.

    For example:

    dns/cmd /recordadd 1.168.192.in-addr.arpa. 3 PTR pc1.bigfirm.com

  3. Mike says:

    Thanks for providing this reference. It”s the best I have found so far.

    Please note that the example for adding NS records is not correct (dnscmd /recordadd bigfirm.com @ A dns3.bigfirm.com) it should read: dnscmd /recordadd bigfirm.com @ NS dns3.bigfirm.com

  4. user says:

    Thanks so much.

  5. HteHix says:

    Adderall And Zoloft Weight Loss Mixing Methadone And Adderall Xanax . adderall time release generic Can I Take Adderall And Vicodin Editing Adderall And Vicodin Adderall Vitamin C Buy Generic Adderall No Prescription Synthroid And Adderall Levothyroxine Sodium . Generic Adderall 20mg 60 Tablets Add Wellbutrin Or Adderall list of generic adderall names order adderall online no prescription. Ritalin Concerta Strattera And Adderall Refills Mixing Strattera With Adderall Strat Children On Adderall And Zoloft How To Get Prescription Adderall .

  6. You could definitely see your enthusiasm in the work
    you write. The arena hopes for even more passionate writers such as you
    who are not afraid to mention how they believe. Always
    follow your heart.

  7. HteHix says:

    Neurontin And Adderall Drug Adderall And Bupropion . Vicodin And Adderall Interaction Birth Control And Adderall Adderall Interaction Xanax Prescription Mixing Methadone And Adderall Xanax Taking And Adderall Prozac Overdose Recording Adderall And Xanax . Benadryl Adderall Drug Interactions Does Ritalin Cause Weight Loss Adderall Concerta Ephedra And Lexapro Adderall buy adderall online. Mixer Ambien And Adderall And Adderall Interactions Snorting Xanax adderall generic provigil adderall .

  8. ZBnum says:

    Xanax 2mg Side Effects Panic Disorder Vicodin Or Xanax Buy Definition Of Green Xanax buy xanax 2mg online. Taking Xanax With Ambien 2mg Wide News Prescription Xanax How Long Does A Dose Of Xanax First Xanax Celexa Panic Disorder . Is Klonopin Better Than Xanax Withdrawal Symptoms Xanax For Rls Dose . Xanax Pies Taking Prozac And Xanax Obsessive Compulsive Disorder Prices For Xanax St John Wort Paxil Xanax Adhd Xanax Seroquel Interaction Pill Xanax

1 Trackbacks

Leave a comment