ajd335 has asked for the wisdom of the Perl Monks concerning the following question:

Hey all, I have a text file which has IP address and host name as well as mac address.Is there any way we can import that file into DNS and at the same time updating DHCP .?? Does the Perl have such type of functionality ? How can I do so? ( as I really don't have any idea how can I do so n I don't wont it to be manually done.) Thanks,

Replies are listed 'Best First'.
Re: importing text to DNS...Code
by eosbuddy (Scribe) on Jul 17, 2008 at 21:05 UTC
    Apologies need further information: what do you mean by DNS and DHCP (is this a windows system or a *nix) - are these text files residing somewhere? Or are these bind .db files that you want updated for localhost? Please clarify by cutting pasting relevant files. Thanks.
      Hi eosbuddy , DNS is the domain name system,whenever you are working or internet or so , you will relay on that , It has track of all the IP address in workstation etc. Dynamic Host Configuration Protocol (DHCP) is a protocol used by networked devices (clients), to obtain the parameters necessary for operation in an Internet Protocol network. And The thing is, We are changing the IP address of the workgroup. After changing , we have a text file which contains all the information about the hostname and the IP address. The problem is , I am not able to figure out some script which can , IMPORT that text file Into DNS , at the same time keeping the DHCP updated. Thanks......I m really donno how to do so...N It's bugging..
        Hi ajd335, I have no doubt about the acronyms of DNS and DHCP ;-) what I wanted to know is the environment within which you want to export your text file of ip and macaddresses. i.e. when you change your systems ip, you also need to change the information on your DNS server - is this server a standard router, a computer with windows running on it or is it a unix/linux based server? If it is a linux based server, the usual DNS program (called bind or littledns or whatever), will have text files that have (for bind) extensions .db - so the solution to your problem will depend on what the system is and whether the perl scrip one writes can be portable to that system. Thanks for your clarifications.
Re: importing text to DNS...Code
by eosbuddy (Scribe) on Jul 18, 2008 at 02:52 UTC
    Hi ajd335, Not sure whether this might be what you're looking for: http://www.perl.com/pub/a/2005/03/24/perl_dns.html claims to allow you make the changes from your workstation. As far as my understanding is right, unless you have some DHCP filters on, mac-addresses might not be relevant. All you need is the computer name (FQDN) and ip-address.
      Hey EosBuddy, Thanks a million....It's something that I was looking for..I have searched regarding the same Wdns.pl and I got some documents , n it was a really the way I want it to be...at least hope that it works well..I gone through the document( as I am real new to these stuff). I will now start working on the same...But , Thank you so much for your help...If I happen to have questions....will ask you..Thanks once again...
      HI Eosbuddy , I tried to use the WDNS.pl script. But , As I am very new to perl , I was wondering do we have to copy the whole WDNS script or what ? ( here DNS is running on windows 2003 ) So do we also have to run that only just windows on which it is working ? I tried n just copy - pasted the script , but dint get any results, so what should be done here ..!
        Hi ajd335, You have to cut and paste the script via notepad into a text file and then run it by opening up a the DOS prompt (on xp: start -> run -> cmd) using the command:
        C:\Documents and Settings> perl WDNS.pl
        more info here: http://www.gossland.com/course/intro/running.html There are also many alternatives to the DOS prompt (here's a gui): http://internetducttape.com/2006/09/08/using-perl-on-windows-part-1-installing-activestate-perl/ There maybe more options out there.
        Hi ajd335, I apologize for the lack of response as I have not been checking perlmonks for the past couple of days. I also regret that I won't be able to help you out much here - it looks like a configuration error at your end and will need someone with perl+network experience, physically sitting at your table to see what is going wrong.