HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: /etc/nsswitch.conf question
Operating System - HP-UX
1834882
Members
2335
Online
110071
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2001 03:58 PM
10-24-2001 03:58 PM
I was having troubles with "localhost" on my 64-bit HP-UX 11.00 machine. Even though the last line of /etc/hosts looks like this:
127.0.0.1 localhost loopback
I could do this fine:
telnet 127.0.0.1 23
but not this:
telnet localhost 23
When I tried "telnet localhost 23" I got the error:
localhost: Unknown host
So I remembered that on Tru64 UNIX I had to change my /etc/svc.conf file to have this line:
hosts=bind,local,yp
and I think that the equivalent file on HP-UX 11.00 is . Below is my /etc/nsswitch.conf file. How should I change it so that "telnet localhost 23" will work for me (the "[NOTFOUND=return]" strings in this file are weird-looking)?!
bwilliam@pokie <93> more /etc/nsswitch.conf
#
# /etc/nsswitch.nis:
#
# An example file that could be copied over to /etc/nsswitch.conf; it
# uses NIS (YP) in conjunction with files.
#
passwd: files nis
group: files nis
hosts: dns [NOTFOUND=return] files
networks: nis [NOTFOUND=return] files
protocols: nis [NOTFOUND=return] files
rpc: nis [NOTFOUND=return] files
publickey: nis [NOTFOUND=return] files
netgroup: nis [NOTFOUND=return] files
automount: files nis
aliases: files nis
services: files nis
127.0.0.1 localhost loopback
I could do this fine:
telnet 127.0.0.1 23
but not this:
telnet localhost 23
When I tried "telnet localhost 23" I got the error:
localhost: Unknown host
So I remembered that on Tru64 UNIX I had to change my /etc/svc.conf file to have this line:
hosts=bind,local,yp
and I think that the equivalent file on HP-UX 11.00 is . Below is my /etc/nsswitch.conf file. How should I change it so that "telnet localhost 23" will work for me (the "[NOTFOUND=return]" strings in this file are weird-looking)?!
bwilliam@pokie <93> more /etc/nsswitch.conf
#
# /etc/nsswitch.nis:
#
# An example file that could be copied over to /etc/nsswitch.conf; it
# uses NIS (YP) in conjunction with files.
#
passwd: files nis
group: files nis
hosts: dns [NOTFOUND=return] files
networks: nis [NOTFOUND=return] files
protocols: nis [NOTFOUND=return] files
rpc: nis [NOTFOUND=return] files
publickey: nis [NOTFOUND=return] files
netgroup: nis [NOTFOUND=return] files
automount: files nis
aliases: files nis
services: files nis
Solved! Go to Solution.
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2001 04:08 PM
10-24-2001 04:08 PM
Solution
Change the DNS resolution to:
hosts: files [NOTFOUND=continue] dns
By searching /etc/hosts first, you will increase reliability of network connections should the DNS server have a mistake or go offline. You can put the most important addresses in this file (important DNS addresses won't change very often).
Bill Hassell, sysadmin
hosts: files [NOTFOUND=continue] dns
By searching /etc/hosts first, you will increase reliability of network connections should the DNS server have a mistake or go offline. You can put the most important addresses in this file (important DNS addresses won't change very often).
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2001 04:11 PM
10-24-2001 04:11 PM
Re: /etc/nsswitch.conf question
Hi:
THe 'return' value means give up.
Try this:
hosts: files [NOTFOUND=continue UNAVAIL=continue] dns [NOTFOUND=continue UNAVAIL=continue TRYAGAIN=continue] nis [NOTFOUND=return UNAVAIL=continue TRYAGAIN=return]
This is all one line in /etc/nsswitch.conf.
The translation is try /etc/hosts first, if the host entry is not found or /etc/hosts is not found go to the next service which is dns.
If not found there continue to nis. Finally if notfound in nis THEN bail out.
man nsswitch.conf for full details.
Clay
THe 'return' value means give up.
Try this:
hosts: files [NOTFOUND=continue UNAVAIL=continue] dns [NOTFOUND=continue UNAVAIL=continue TRYAGAIN=continue] nis [NOTFOUND=return UNAVAIL=continue TRYAGAIN=return]
This is all one line in /etc/nsswitch.conf.
The translation is try /etc/hosts first, if the host entry is not found or /etc/hosts is not found go to the next service which is dns.
If not found there continue to nis. Finally if notfound in nis THEN bail out.
man nsswitch.conf for full details.
Clay
If it ain't broke, I can fix that.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP