Solved

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

Posted on 2006-07-13
5
11,301 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is in response to a question (http://www.experts-exchange.com/Networking/Network_Management/Network_Analysis/Q_28230497.html) here at Experts Exchange. The Original Poster (OP) requires a utility that will accept a list of IP addresses …
We recently endured a series of broadcast storms that caused our ISP to shut us down for brief periods of time. After going through a multitude of tests, we determined that the issue was related to Intel NIC drivers on some new HP desktop computers …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

734 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