Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

13.12. dnscmd Cheat Sheet

This has been a long chapter, I know, and thank you for staying with me to its end. I cannot stress enough that knowing DNS is one of the most essential arts for any successful network administrator, and if you review and learn what we've covered here then you'll be well on the way to DNS proficiency. Before I go, however, I want to leave you with a small gift — my dnscmd cheat sheet. You've already heard me preach about the power and value of the command line, so I won't do that again, but I will agree that the CLI requires a bit more remembering than GUIs do, so I hope this table makes that remembering a bit easier. (And don't forget that there's still more to learn about DNS's AD-specific aspects — but we'll take those up in Essential Technologies!) This is by no means a complete explanation of everything that dnscmd does — just the stuff that I use regularly.

Functiondnscmd OptionExampleComments
Do any dnscmd command on a remote systemdnscmd remoteservername commanddnscmd main.bigfirm.com /zoneprint bigfirm.com 
Create a primary zonednscmd /zoneadd zonename /primarydnscmd /zoneadd bigfirm.com/primary 
Create a secondary zonednscmd /zoneadd zonename /secondary master IP addressdnscmd /zoneadd bigfirm.com /secondary 192.168.1.1 
Host a zone on a server based on an existing (perhaps restored) zone filednscmd /zoneaddzonename /primary /filefilename /loaddnscmd /zoneadd bigfirm.com /primary /file bigfirm.com.dns /load 
Delete a zone from a serverdnscmd /zonedeletezonename [/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 serverdnscmd /enumzonesdnscmd /enumzones 
Dump (almost) all of the records in a zonednscmd /zoneprint zonenamednscmd /zoneprint bigfirm.comDoesn't show glue records.
Add an A record to a zonednscmd /recordadd zonename hostname A ipaddressdnscmd /recordadd bigfirm.com mypc A 192.168.1.33 
Add an NS record to a zonednscmd /recordadd zonename @NS servernamednscmd /recordadd bigfirm.com @ A dns3.bigfirm.com 
Delegate a new child domain, naming its first DNS serverdnscmd /recordadd zonename childname NSdnsservernamednscmd /recordadd bigfirm.com test NS main.bigfirm.comThis would create the test.bigfirm.com DNS child domain under the bigfirm.com DNS domain.
Add an MX record to a zonednscmd /recordadd zonename @MXpriority servernamednscmd /recordadd bigfirm.com @MX10 mail.bigfirm.com 
Add a PTR record to a reverse lookup zonednscmd /recordadd zonename lowIP PTR FQDNdnscmd /recordadd 1.168.192.in-addr .arpa 3 A pc1.bigfirm.comThis is the PTR record for a system with IP address 192.168.1.3.
Modify a zone's SOA recorddnscmd /recordadd zonename @SOA primaryDNSservername responsible-emailipaddress serialnumber refreshinterval retryinterval expireinterval defaultTTLdnscmd /recordadd bigfirm.com @SOA winserver.bigfirm.com mark.bigfirm.com 41 1800 60 2592000 7200Ignores the serial number if it's not greater than the current serial number.
Delete a resource recorddnscmd /recorddelete zonename recordinfo [/f]dnscmd /recorddelete bigfirm.com @ NS main.bigfirm.com /fAgain, /f means "don't annoy me with a confirmation request, just do it."
Create a resource record and incorporate a nonstandard TTLdnscmd /recordadd zonename leftmostpartofrecord TTL restofrecorddnscmd /recordadd bigfirm.com pc34 3200A192.168.1.4 
Reload a zone from its zone file in \windows\sustem32\dnsdnscmd /zonereload zonenamednscmd /zonereload bigfirm.comReally only useful on primary DNS servers.
Force DNS server to flush DNS data to zone filednscmd /zonewritebackzonenamednscmd /zonewriteback bigfirm.com 
Tell a primary whom to allow zone transfers todnscmd /zoneresetsecondaries zonename /nonsecure|securensdnscmd /zoneresetsecondaries bigfirm.com /nonsecureThat example says to allow anyone who asks to get a zone transfer.
Enable/ disable DNS NOTIFYdnscmd /zoneresetsecondaries zonename /notify|/nonotifydnscmd /zoneresetsecondaries bigfirm.com /nonotifyExample disables DNS notification, which is contrary to the default settings.
Tell a secondary DNS server to request any updates from the primarydnscmd /zonerefreshzonenamednscmd /zonerefresh bigfirm.com 
Enable or disable dynamic DNS on a zonednscmd /configzonename /allowupdate 1|01 enables, 0 disables, 0 is default 
Stop the DNS serviceEither net stop dns or sc stop dns (No dnscmd command for this.)
Start the DNS serviceEither net start dns or sc start dns (No dnscmd command for this.)
Install the DNS service on a 2008 full install systemservermanage rcmd -install dns  
Install the DNS service on a 2008 Server Core systemocsetup DNS-Server-Core-Role Case matters — ocsetup dns-server-core-role would fail.
Uninstall the DNS service on a 2008 Server full install systemservermanagercmd -remove dns  
Uninstall the DNS service on a 2008 Server Core systemocsetup /uninstall DNS-Server-Core-Role  
Configure a client's preferred DNS servernetsh int ip set dnsconnectionname staticipaddressnetsh int ip set dns "local area connection" static 192.168.1.7 
Configure a client's alternate DNS servernetsh int ip add dnsipaddress index=ordinalnetsh int ip add dns "local area connection" 192.168.1.200 index=2You may include as many extra DNS servers as you like; just change the index value.



  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint