Locate DNS record and create record if its missing

Tech-Archive recommends: Fix windows errors by optimizing your registry



Folks, I'd like to do be able to script the following...

1. Check MS DNS to see if a CNAME record exisits
2. If it doesn't exisit I'd like to use a script to create it.

I was thinking of using the following but it doesn't seem very slick. Any
ideas?

'Run the following Command to a text file

nslookup -type=cname aliasForTesting.mydomain.net > C:\nslookup.txt


'Open the text file with something similar to

set objFSO=CreateObject("Scripting.FileSystemObject")
set objFile=objFSO.OpenTextFile(strFilePath, 1)

'Parse the txt file

'If there is no response then perform the following:

C:\Program Files\Support Tools\dnscmd.exe server01.mydomain.net /RecordAdd
mydomain.net TestingAliasAdd /Aging 60 CNAME server01.mydomain.net



.



Relevant Pages

  • Re: Locate DNS record and create record if its missing
    ... Check MS DNS to see if a CNAME record exisits ... If it doesn't exisit I'd like to use a script to create it. ... You can use WMI to manage DNS records. ...
    (microsoft.public.scripting.vbscript)
  • Re: Is there a way to forward only email to someone@AOL.com to a s
    ... Also on this site there is a way to test if your script ... map to ourdomain.com in DNS ... you for helping us to solve our SBS problems. ... I have other people on Verizon and they can send to AOL.com users. ...
    (microsoft.public.windows.server.sbs)
  • Re: Dynamic DNS management
    ... One of the irritations is that with a dynamic DNS, ... the IP addresses for the authoritative DNS server of multiple domains ... In the script, the above line is repeated for each domain; ... Perl has very good pattern matching. ...
    (comp.lang.perl.misc)
  • Solaris tuning
    ... new DNS infrastructure. ... behavior for me) that needs to be increased so this script can take ... server 198.18.0.12 ... def start: ...
    (comp.unix.solaris)
  • nsupdate(8) rc.d Script
    ... Subject: nsupdaterc.d Script ... As I was setting up DNS for IPv6 on a test network, ... And the script is not optimized to do the updates in the ...
    (freebsd-current)