Locate DNS record and create record if its missing
- From: littlsm <littlsm@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 3 Nov 2008 14:45:02 -0800
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
.
- Follow-Ups:
- Re: Locate DNS record and create record if its missing
- From: Richard Mueller [MVP]
- Re: Locate DNS record and create record if its missing
- Prev by Date: Re: Weird script issues
- Next by Date: VBScript nesting groups cross domains
- Previous by thread: Re: Weird script issues
- Next by thread: Re: Locate DNS record and create record if its missing
- Index(es):
Relevant Pages
|