Networking
cancel
Showing results for 
Search instead for 
Did you mean: 

Nslookup does not work properly

Vivek Bhatia
Trusted Contributor

Nslookup does not work properly

Hi Experts,

I am running nslookup from the same server but with the different user accounts on 11.31

Have a look at the different outputs below.

From root user account
#nslookup -swdebug lonunx02
could not open /etc/nsswitch.conf
__nsw_getconfig: NO POLICY FILE
__nsw_getdefault: default hosts lookup policy
Name Server: lonads02.eu.colt
Address: 10.144.18.53

Trying DNS
Name: lonunx02.eu.colt
Address: 10.100.5.248

From Oracle User
$nslookup -swdebug lonunx02
could not open /etc/nsswitch.conf
__nsw_getconfig: NO POLICY FILE
__nsw_getdefault: default hosts lookup policy
Using /etc/hosts on: lonvps07

looking up FILES
*** No address information is available for "lonunx02"

Please share your expert advice on this to fix it.As i expect the nslookup to work same as the one working from the root account.

Thanks
Vivek
6 REPLIES
Bill Hassell
Honored Contributor

Re: Nslookup does not work properly

Most likely your /etc/nsswitch.conf file is not readable for ordinary users. The correct permissions for /etc/nsswitch.conf is 644. You can also verify resolver actions by using nsquery:

nsquery hosts lonunx02


Bill Hassell, sysadmin
Steven Schweda
Honored Contributor

Re: Nslookup does not work properly

> could not open /etc/nsswitch.conf

You're not curious?

ls -l /etc/nsswitch.conf

> Using /etc/hosts [...]

You're not curious?

ls -l /etc/hosts

> [...] i expect the nslookup to work same as
> the one working from the root account.

Then everyone should have read permission on
these files.
rariasn
Honored Contributor

Re: Nslookup does not work properly

Hi,

# chmod 444 /etc/hosts

rgs,
Vivek Bhatia
Trusted Contributor

Re: Nslookup does not work properly

HI Guys,

Thanks for helping me on this issue.

The issue was with the /etc/resolv.conf as it was not having right permissions for oracle to read.So i changed the permissions and then it worked.As in the 11.31 nsswitch is not present by default.

Thanks
Vivek Bhatia
Steven E. Protter
Exalted Contributor

Re: Nslookup does not work properly

Shalom,

When a system is installed there are several candidate /etc/nsswitch files.

There is not an /etc/nsswitch.conf file in production.

The systems administrator needs to create nsswitch.conf, which usually involves copying one of the candidate files to become nsswitch.conf

After that, you will with an /etc/resolv.conf file have some chance of nsslookup working.

Both configuration files have man pages to help you get them configured.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Vivek Bhatia
Trusted Contributor

Re: Nslookup does not work properly

Thanks