Solved

How to add a DNS entry through command line in Windows....

Posted on 2006-07-13
5
11,278 Views
Last Modified: 2010-01-11
Hi ,

I would like to add DNS entry for the windows client machine, is there any command line utility where i can add the entry...
If any of you guys plz let me know.

Thanks inadvance,
MC.
0
Comment
Question by:Mohan Shivaiah
  • 3
5 Comments
 
LVL 57

Expert Comment

by:Pete Long
ID: 17097700
Hi mohan_sh,
DNS Scripting http://www.windowsitpro.com/Article/ArticleID/37719/37719.html
or if its just a couple of records

You can use dnscmd.exe which is part of support tools to add a A record.
The syntax is like

dnscmd.exe dnsserver /recordadd zonename hostname A ipaddress

Cheers!
0
 
LVL 57

Expert Comment

by:Pete Long
ID: 17097712
PeteLong,
dnscmd PRIMARY /recordadd contoso.COM @ A 1.1.1.1
//sets up the record on the primary server for contoso.COM pointing to the IP 10.1.1.1

see http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/9dec9c21-27d1-4781-9ef8-6555a804a79f.mspx?mfr=true
0
 
LVL 57

Accepted Solution

by:
Pete Long earned 20 total points
ID: 17097728
PeteLong,
From Batch FIle

From
http://cwashington.netreach.net/dep...iptType=command

Script:

The BAT file creates a series of record into DNS.
It uses as input the file LISTA.TXT. In this file you have
to specify the name of the record and the value that
it wil have.

IF you open the BAT file you'll see that you have
to specify also after DNSCMD a server that contain
the zone (SERVERNAME) the parameter /RecordADD, to add the
record and the ZONE where you want to add the record.

You can also specify if the record you want to add
is an HOST or an ALIAS. To do so you have to put
beetween the RECORD_NAME; and the value XXX.XXX.XXX.XXX or alias the value:

A = HOST
CNAME = ALIAS

so the result of the string inside the input.txt result:

RECORD_2_ADD;A;IP_ADDRESS

OR

RECORD_2_ADD;CNAME;ALIAS_WHERE_POINT


BATCH FILE:
********

for /f "tokens=1-3 delims=;" %%a in (input.txt) do (
dnscmd SERVERNAME /RecordAdd ZONE_WHERE_ADD_RECORD %%a %%b %%c >>insert.log)
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Nslookup is a command line driven utility supplied as part of most Windows operating systems that can reveal information related to domain names and the Internet Protocol (IP) addresses associated with them. In simple terms, it is a tool that can …
A common practice in small networks is making file sharing easy which works extremely well when intra-network security is not an issue. In essence, everyone, that is "Everyone", is given access to all of the shared files - often the entire C: drive …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) 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…

747 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

9 Experts available now in Live!

Get 1:1 Help Now