Solved

DNS to hosts-file?

Posted on 2012-03-29
4
478 Views
Last Modified: 2012-04-20
Hi,

Is there a way to extract DNS-entries into a hosts-file (C:\WINDOWS\system32\drivers\etc) automatically?

This exports to a txt-file but I would like to have it automatically to hosts:
http://www.techrepublic.com/blog/networking/export-dns-zones-to-a-text-file/1608

Thanks for your input.
J.
0
Comment
Question by:janhoedt
[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
4 Comments
 
LVL 35

Expert Comment

by:Ernie Beek
ID: 37781330
If it is the same format as the hosts file you could just add it:
type c:\windows\system32\dns\rwvdev-dot-intra.txt >> C:\WINDOWS\system32\drivers\etc\hosts
0
 
LVL 26

Accepted Solution

by:
Leon Fester earned 500 total points
ID: 37784534
There are no native tools that I know of for this, since the basic structure of a DNS zone is different to that of a Hosts file.

You're easiest option would be to setup a MS-Excel macro to read your DNS zone file, copy the data and strip the unneccessary columns and then save the file in the hosts. format.

e.g. of DNS Zone file entry
foo           IN A      21.160.109.58

e.g. of Host file entry
127.0.0.1                   localhost
64.156.132.150         www.experts-exchange.com
0
 

Author Comment

by:janhoedt
ID: 37799890
Howto configure this macro? Never worked with macro's before.
0

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

A safe way to clean winsxs folder from your windows server 2008 R2 editions
While rebooting windows server 2003 server , it's showing "active directory rebuilding indices please wait" at startup. It took a little while for this process to complete and once we logged on not all the services were started so another reboot is …
This tutorial will walk an individual through locating and launching the BEUtility application to properly change the service account username and\or password in situation where it may be necessary or where the password has been inadvertently change…
This tutorial will show how to configure a single USB drive with a separate folder for each day of the week. This will allow each of the backups to be kept separate preventing the previous day’s backup from being overwritten. The USB drive must be s…

726 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