Can I script entries to the Windows DNS server?

Posted on 2006-05-20
Last Modified: 2010-04-18
I regularly have a requirement to make the same change to every host listed in my DNS servers.
I want to script this in a batch file, or simular.

Please provide links to documentation for such, &/or post examples of how to make an entry on all domains (without having to list all the domains in the batch file!)
Question by:CraigHarris
    LVL 95

    Expert Comment

    by:Lee W, MVP
    LVL 7

    Author Comment

    My servers are Windows 2003 R2 Standard, 64bit edition -- a solution which works directly on such is required.
    LVL 95

    Expert Comment

    by:Lee W, MVP
    Would have helped if you mentioned that little detail in the question...
    LVL 7

    Author Comment

    (I did ask in the Windows 2003 section)
    But yeah, 64bit causes issues due to Microsoft not supporting most tools on this platform :( !
    LVL 33

    Accepted Solution

    Maybe the DNSCMD might help?  Not sure...

    C:\Documents and Settings\me>dnscmd /RecordAdd /?
    Usage: DnsCmd <ServerName> /RecordAdd <Zone> <NodeName> [/Aging] [/OpenAcl]
                  [<Ttl>] <RRType> <RRData>

      <RRType>          <RRData>
        A               <IPAddress>
        NS,CNAME,MB,MD  <HostName|DomainName>
        PTR,MF,MG,MR    <HostName|DomainName>
        MX,RT,AFSDB     <Preference> <ServerName>
        SRV             <Priority> <Weight> <Port> <HostName>
        SOA             <PrimaryServer> <AdminEmail> <Serial#>
                          <Refresh> <Retry> <Expire> <MinTTL>
        AAAA            <Ipv6Address>
        TXT             <String> [<String>]
        X25,HINFO,ISDN  <String> [<String>]
        MINFO,RP        <MailboxName> <ErrMailboxName>
        WKS             <Protocol> <IPAddress> <Service> [<Service>]..]
        KEY             <Flags> <KeyProtocol> <CryptoAlgorithm> <Base64Data>
        SIG             <TypeCovered> <CryptoAlgorithm> <LabelCount>
                          <OriginalTTL> <SigExpiration> <SigInception>
                          <KeyTag> <Signer's Name> <Base64Data>
        NXT             <NextName> <Type> [<Type>...]
        WINS            <MapFlag> <LookupTimeout>
                          <CacheTimeout> <IPAddress> [<IPAddress>]
        WINSR           <MapFlag> <LookupTimeout>
                         <CacheTimeout> <RstDomainName>
      <Zone>            -- <ZoneName> | /RootHints
      <ZoneName>        -- FQDN of a zone
      <NodeName>        -- name of node to which a record will be added
                           - FQDN of a node  (name with a '.' at the end) OR
                           - node name relative to the ZoneName           OR
                           - "@" for zone root node                       OR
                           - service name for SRV only (e.g. _ftp._tcp)
      <Ttl>             -- TTL for the RR  (Default: TTL defined in SOA)
      <HostName>        -- FQDN of a host
      <IPAddress>       -- e.g.
      <ipv6Address>     -- e.g.  1:2:3:4:5:6:7:8
      <Protocol>        -- UDP | TCP
      <Service>         -- e.g.  domain, smtp
      <TypeCovered>     -- type of the RRset signed by this SIG
      <CryptoAlgorithm> -- 1=RSA/MD5, 2=Diffie-Hellman, 3=DSA
      <SigExpiration>   -- yyyymmddhhmmss - GMT
      <SigInception>    -- yyyymmddhhmmss - GMT
      <KeyTag>          -- used to discriminate between multiple SIGs
      <Signer's Name>   -- domain name of signer
      <KeyProtocol>     -- 1=TLS, 2=email, 3=DNSSEC, 4=IPSEC
      <Base64Data>      -- KEY or SIG binary data in base64 notation
      <NextName>        -- domain name of next RRSet in zone
    LVL 7

    Author Comment

    I don't have dnscmd on the server - any idea how I can get it for 64bit Windows?
    LVL 33

    Expert Comment


    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Recently, I had the need to build a standalone system to run a point-of-sale system. I’m running this on a low-voltage Atom processor, so I wanted a light-weight operating system, but still needed Windows. I chose to use Microsoft Windows Server 200…
    I've always wanted to allow a user to have a printer no matter where they login. The steps below will show you how to achieve just that. In this Article I'll show how to deploy printers automatically with group policy and then using security fil…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    746 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

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now