[RHEL 5] What means the error 'nslookup: parse of /etc/resolv.conf failed'

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux 5 (all releases)

Issue

  • The command 'nslookup <server_name>' return the error bellow:

              nslookup: parse of /etc/resolv.conf failed
    

Resolution

  • Check if your /etc/resolv.conf file have any unknow option or any error in some parameter.

Root Cause

  • When you run the nslookup the system check the /etc/resolv.conf file to get informations about domains and about the DNS. If you have any wrong parameter in this file the nslookup command return the error listed above.

Diagnostic Steps

  • Check if you find any error in the /etc/resolv.conf file:

              # cat /etc/resolv.conf
    
              nameserver 1.2.3.4
              nameserver 4.3.2.1
              options timeout:0.3
    

In the above output the timeout parameter from the option session have a . (dot). The timeout have to be set in secondas, but it have to be a integer. as you can see in 'man resolv.conf'

timeout:n
     sets the amount of time the resolver will wait for a response from a remote name server before retrying the query via a different name server.   Measured  in  seconds,
     the default is RES_TIMEOUT (currently 5, see <resolv.h>).  The maximum value for this option is silently capped to 30.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments