Solved

Import DNS txt file into Windows DNS Server

Posted on 2008-10-08
6
10,330 Views
Last Modified: 2012-05-05
In my company we have thousands of switches and routers with unique host names and I have list with all the host names and IP addresses that are in only 1 servers host file.  I wanted to import this host file into my 2 Windows Domain Controllers running DNS.  How do I import a TXT or CSV (either or) file into a Windows DNS server?
0
Comment
Question by:Ensilence
6 Comments
 
LVL 18

Expert Comment

by:sk_raja_raja
ID: 22672462
0
 
LVL 23

Expert Comment

by:bhanukir7
ID: 22672789
Hi,

i think this post on MS can help you. This post talks about reverse address zone but you can get help for  you text file by using the DNS import export tool

http://blogs.msdn.com/richpec/archive/2008/08/24/how-to-consolidate-many-reverse-dns-zones-into-fewer-larger-reverse-dns-zones.aspx

or use this which talks about importing text file to unix DNS (BINDS) and then importing that to windows dns server.



http://www.eggheadcafe.com/forumarchives/windowsserverdns/Aug2005/post23676167.asp

bhanu
0
 
LVL 70

Accepted Solution

by:
Chris Dent earned 250 total points
ID: 22673054

> I wanted to import this host file into my 2 Windows Domain Controllers running DNS.  
> How do I import a TXT or CSV (either or) file into a Windows DNS server?

It actually works really easily using DNSCMD, a bit of playing in Excel and the drag down.

DNSCMD from the support tools has a /RecordAdd option we can use. All you have to do in Excel is complete the command :)

e.g.

Column A (RecordAdd and domain)
DNSCMD /RecordAdd youdomain.com

Column B (Name)
"Host Name"

Column C (Record Type)
A

Column D (IP Address)
1.2.3.4

Drag down columns A and C. Paste into Notepad, now you have have a batch file that can add all the records for you :)

If that's no good, there are scripting methods we can use for the more automated approach :)

Chris
0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
LVL 23

Expert Comment

by:bhanukir7
ID: 22673181
Hi Chris

That seems to be the easiest way.  Hope this would be helpful to the asker too.

bhanu
0
 

Author Comment

by:Ensilence
ID: 22674169
Chris,

I will take a look at what the DNSCMD is and how it can help me.  Right now what I am working with is a users host file from the drivers\etc dir and has all the host names and IPs populated.  Like:
10.45.1.254   Site45rtr01
10.46.1.254   Site46rtr01
10.47.1.254   Site47rtr01
10.48.1.254   Site48rtr01
10.49.1.254   Site49rtr01
10.50.1.254   Site50rtr01
10.52.1.254   Site51rtr01

My Excell skills are old but you can teach this dog new tricks.  I will look at what you suggested about using Excel but I am wondering if there was an easier way to import this lame TXT file list into DNS and populate the A records etc. I am currently using or looking at dnsmgmt console.  Kind of clueless to this function I want to perform.  Limited research online had suggested editing a .DNS file or something...?  Any more words would likely be greatly appreciated.  
0
 
LVL 70

Expert Comment

by:Chris Dent
ID: 22676423

There's nothing simple in the DNS console that will let you I'm afraid.

If your zone were not AD Integrated you would have a text file for the zone file, that's the one with the .dns extension it would have hidden in %SystemRoot%\System32\DNS\. AD Integration moves that data into Active Directory itself as objects we won't be able to write directly.

We can, of course, write a script to rip apart the text file and construct the relevant records for us. And we could use WMI to add those in, it's not difficult if you're experienced with the interface at all.

However, using DNSCMD and the method described above will give you a much easier view of the changes if you aren't familiar with the scripting interfaces (either VbScript or PowerShell if I'm doing it).

I'm more than happy to show you the scripted methods if you prefer those :)

Chris
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

Issue: One Windows 2008 R2 64bit server on the network unable to connect to a buffalo Device (Linkstation) with firmware version 1.56. There are a total of four servers on the network this being one of them. Troubleshooting Steps: Connect via h…
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

809 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