1831891 Members
3109 Online
110031 Solutions
New Discussion

unable to login remotely

 
SOLVED
Go to solution
Norman_21
Honored Contributor

unable to login remotely

Hi again,

the file nsswitch.conf is not available under /etc , however
I have attached a sample of another file nsswitch.nis, please check the contents of the file and let me know if I should make any changes. Also, is this why the users could not login remotely before I remove the /etc/resolv.conf. Is it the case that if the
/etc/resolv.conf is available and the /etc/nsswitch.conf is not available, the /etc/hosts file will be ignored. If yes, I beleive that was the problem.
I still need some thoughts.
Thnx.
Please check attachment for sample of my nsswitch.nis.
"Attitudes are contagious, is yours worth catching"/ My first point was given by SEP on January 31, 2003
10 REPLIES 10
Stefan Farrelly
Honored Contributor
Solution

Re: unable to login remotely


There are always backup copies of scripts such as /etc/nsswitch.nis in /usr/newconfig/etc - take a look. These are backup copies from the initial install - very handy.

Im from Palmerston North, New Zealand, but somehow ended up in London...
T G Manikandan
Honored Contributor

Re: unable to login remotely

There are three sample files for nsswitch.conf in the /etc directory.

they are
nsswitch.nis
nsswitch.nisplus
nsswitch.files

If you have configured nis then you can copy the nsswitch.nis to nsswitch.conf.
If you are just using files then you can copy the nsswitch.files to nsswitch.conf.

if you are just using files for passwd,group,networks,etc then for your dns setting just make changes like

passwd: files
group: files
hosts: dns [NOTFOUND=return] files
services: files
networks: files
protocols: files
rpc: files
publickey: files
netgroup: files
automount: files
aliases: files

Then make sure that you have the /etc/resolv.conf like

domainname
nameserver


Thanks
T G Manikandan
Honored Contributor

Re: unable to login remotely

resolv.conf

domain
nameserver
Darrell Allen
Honored Contributor

Re: unable to login remotely

Hi,

"man 4 nsswitch.conf" shows the default search order for hostname resolution is:
hosts: nis [NOTFOUND=return] files
Therefore, without nsswitch.conf, hostname resolution will try "nis" before looking at "files" (/etc/hosts) and DNS will not be used.

If you are not using NIS, you should create /etc/nsswitch.conf without specifying nis.

If you are not using DNS, it doesn't matter if you have /etc/resolv.conf or not. However, if you specify dns in nsswitch.conf and resolv.conf does not exist, DNS will not know how to resolve hostnames.

For your question "Is it the case that if the
/etc/resolv.conf is available and the /etc/nsswitch.conf is not available, the /etc/hosts file will be ignored" - the answer is no. The reason is found above in my first paragraph concerning the default search order for hostname resolution.

Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)
Darrell Allen
Honored Contributor

Re: unable to login remotely

Hi again,

I am at least partially wrong.

I just read another thread that said only DNS is used if /etc/resolv.conf exists and /etc/nsswitch.conf does not exist.

Here's what testing on my 11.0 system showed:

root:/etc # ll nsswitch.conf resolv.conf
nsswitch.conf not found
-rw-r--r-- 1 root sys 66 Oct 25 10:06 resolv.conf
root:/etc # nslookup pdc
Name Server: ns1.xxxxx.com
Address: xx.xx.xx.xx

Trying DNS
Trying NIS
looking up FILES
Name: pdc
Address: xx.xx.xx.xx

The above output shows that DNS, the NIS, then /etc/hosts was the search order.

Maybe the man page simply wasn't updated to reflect changed behavior that was introduced by a patch.

This is all the more reason to create nsswitch.conf and specify exactly what search order you need.

Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)
Norman_21
Honored Contributor

Re: unable to login remotely

Thanks alot guys,

All of the answers are realy useful. However, it seems that I was told that the users were unable to login remotely whereas the truth is that they were able to login but unable to exchange data with the server.. when I renamed the resolv.conf that problem was gone and I was realy was just trying to make the msg " unable to qualify my own domain using short name" go away..but here I'm having the same msg back again after renaming the resolv.conf

One more thing, the book HP certified for Rafeeq Ur-Rehamn states the input of the resolv.conf as following:
search
servername
please let me know what is it differe search from domain..
Thanks alot again.
"Attitudes are contagious, is yours worth catching"/ My first point was given by SEP on January 31, 2003
Tony Contratto
Respected Contributor

Re: unable to login remotely

Hi,

"domain" defines the local domain name of the system.
"search" defines domains names to be searched if a fully qualified domain name (FQDN) is not given.

an example for the host server1.example.com would be:

domain example.com
search example.com otherdomain.com
nameserver


The search line above tells the resolver to try to resolve a lookup for "hostname" as "hostname.example.com" first, then if that fails to try "hostname.otherdomain.com"

Note: The search list is curretly limited to 6 domains with a total of 256 characters.

--
Tony
got root?
Tony Contratto
Respected Contributor

Re: unable to login remotely

Hi again,

More information about the resolv.conf file can be found in the man pages.

# man resolver


--
Tony
got root?
John Dvorchak
Honored Contributor

Re: unable to login remotely

One more thing is you might try putting the servers ip address and fully qualified domain name as the first data entry in you /etc/hosts file. That may help you resolve your own name.

I am still a littel confused though about why and what difficulties you are having. They appear to me to be a problem of resolving the clients address using your DNS. If they are not in you companies DNS then you may try changing the /etc/nsswitch.conf file as follows to get your resolver to look at /etc/hosts first.

hosts: files [NOTFOUND=continue] dns [NOTFOUND=return]

Then put your /etc/resolv.conf file back. Talking about the /etc/resolv.conf file, if you have a "search" line the "domain" line is ignored and your local domain should be listed first.
If it has wheels or a skirt, you can't afford it.
Norman_21
Honored Contributor

Re: unable to login remotely

Closed...
"Attitudes are contagious, is yours worth catching"/ My first point was given by SEP on January 31, 2003