- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- "ntpq -p" error: can not find local host
Categories
Company
Local Language
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
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
Community
Resources
Forums
Blogs
- 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
06-21-2002 01:50 PM
06-21-2002 01:50 PM
I installed ntp in my workstations. But When I "ntpq -p",there is error message:
can not find localhost
Then I "ps -a", I do not find ntp process.
Would someone please tell me what is wrong?
Thanks a lot.
zhiyong
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2002 01:56 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2002 02:07 PM
06-21-2002 02:07 PM
Re: "ntpq -p" error: can not find local host
Thanks for your reply. The localhost is defined in /etc/hosts file. The contents of /etc/resolv.conf:
domain ohsu.edu
nameserver 137.53.1.30
nameserver 137.53.203.5
zhiyong
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2002 02:08 PM
06-21-2002 02:08 PM
Re: "ntpq -p" error: can not find local host
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2002 02:15 PM
06-21-2002 02:15 PM
Re: "ntpq -p" error: can not find local host
I do not have nsswitch.conf file in etc. Would you please tell me What is use of this file? and what should be put into this file?
Thanks a lot.
zhiyong
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2002 06:59 PM
06-21-2002 06:59 PM
Re: "ntpq -p" error: can not find local host
/etc/nsswitch.conf file is used to find order of lookup for various sources of OS like passwd,hosts.
It is a name service configuration file.
For ex.
the order of lookup for to resolve your host names
whether first through your /etc/hosts file or using your DNS server..
If you are not using the DNS the machine you can copy the /etc/nsswitch.files /etc/nsswitch.conf
If you are using DNS then you can just edit the /etc/nsswitch.conf file and then make an entry like the below
hosts : dns{NOTFOUND=return} files
Please post the /etc/hosts and /etc/nsswitch.conf contents
thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2002 08:08 PM
06-21-2002 08:08 PM
Re: "ntpq -p" error: can not find local host
However, I would strongly recommend this entry for the hosts line:
hosts: files[NOTFOUND=continue UNAVAIL=continue] dns [NOTFOUND=return UNAVAIL=continue TRYAGAIN=return]
T*The above is one long line)
The reason is that /etc/hosts is 10x-100x faster if resolving IP/hostnames and by putting the most important production servers into /etc/hosts, system reliability goes up tremendously.
The failure you are seeing is that localhost is totally unknown in your DNS servers (as well it should be).
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2002 01:04 AM
06-22-2002 01:04 AM
Re: "ntpq -p" error: can not find local host
/etc/nsswitch.conf holds the look-up rules e.g
hosts: files nis dns #... and so on
/etc/resolv.conf holds the nameserver to use for lookups i.e. DNS servers may look like
doamin someplace.com
search somplace.com
nameserver 172.12.15.1
nameserver ....
There seems to be some confusion over the two files above...
otherwise (as far as I can tell) the advice is good
Tim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2002 06:05 PM
06-22-2002 06:05 PM
Re: "ntpq -p" error: can not find local host
hosts: files nis dns
is a bit too undefined. Do you have NIS? If not, don't specify it in nsswitch.conf. Also, both resolv.conf and nsswitch.conf must be permissions: 644 so that everyone can read the rules.
Now change the nsswitch.conf line to:
hosts: files[NOTFOUND=continue UNAVAIL=continue] dns [NOTFOUND=return UNAVAIL=continue TRYAGAIN=return]
Finally, use:
nslookup localhost
to see what you get. It should look at FILES and then find localhost.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2002 06:37 PM
06-22-2002 06:37 PM
Re: "ntpq -p" error: can not find local host
Once you have sorted out nsswitch.conf and related resolver checks,
make sure your ntp configuration is set correctly. The /etc/ntp.conf file should have the entry like this:
server HOSTNAME version 3 prefer
(where hostname is the NTP server name)
Then run ntp by
#/sbin/init.d/xntp start
and check by ps -ef |grep ntp
HTH
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2002 04:01 AM
06-24-2002 04:01 AM
Re: "ntpq -p" error: can not find local host
The instructions are really helpful. I can use ntpq -p now.
Thanks a lot!
zhiyong