in reply to find DNS of local server

For clarification, lets see if I'm guessing right.

If I've divined your question correctly, I still have to guess the operating system.

Linux and Solaris and most Un*x varieties allow anyone to read the /etc/resolv.conf file, which may include one or two lines beginning with "nameserver". If not, you're going to have to do more legwork.

Windows NT can list the nameservers if your script can (1) execute and (2) parse the output of the ipconfig command. There may be Win32::* ways to do this more directly.

--
[ e d @ h a l l e y . c c ]

Replies are listed 'Best First'.
Re: Re: find DNS of local server
by Anonymous Monk on May 12, 2003 at 14:19 UTC
    no, I have ten servers and each has the same script on it but needs to do different things depending on which server it is on

    rather than hard coding different server names into the script I want to use just one script, which checks which server it is on and then does the appropriate things

    ie if I am of server1 then do A
    if I am on server2 then do B
    etc