Im trying to write a script using the host command but its not working properly. I cant understand what Im doing wrong. When I use it at the command prompt, it works fine. But its being used actually in the script, it says its not found: 2 SERVFAIL. Can anyone help me? Here's what I have so far: no matter which way I've tried it, its not reading the IP address. Im using yahoo's address as a reference.
Please post:
1) Operating System and Version.
2) Which Shell you are using.
3) The contents of the file /etc/resolv.conf . A Name Server Lookup can only work if your system has access to a Name Server. To look up Internet Addresses, this needs to be an Internet Name Server which is visible from your local network. The SERVFAIL message implies that you do not have a valid DNS (Domain Name Server) or that the DNS server has failed.
4) The actual contents of your script, what you typed to invoke the script verbatim, and any output.
5) The name of the script. The error message impiles that your script is called nslookup which is the name of a system command called by the host command. Change the name of your script!
6) Hmm, the error message refers to line 6 and your script as posted does not have 6 lines. Let's see what you actually executed.