Solved

DNS to hosts-file?

Posted on 2012-03-29
4
453 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
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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

To effectively work with Diskpart on a Server Core, it is necessary to write some small batch script's, because you can't execute diskpart in a remote powershell session. To get startet, place the Diskpart batch script's into a share on your loca…
A quick step-by-step overview of installing and configuring Carbonite Server Backup.
This tutorial will walk an individual through the steps necessary to configure their installation of BackupExec 2012 to use network shared disk space. Verify that the path to the shared storage is valid and that data can be written to that location:…
This tutorial will show how to configure a new Backup Exec 2012 server and move an existing database to that server with the use of the BEUtility. Install Backup Exec 2012 on the new server and apply all of the latest hotfixes and service packs. The…

914 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

12 Experts available now in Live!

Get 1:1 Help Now