Problem starting xntpd daemon on the server


I have created ntp.conf for the server and client, after running xntpd start on both server and client, I only see xntpd process running on the client not the server (ps -ef | grep xntpd). Could anyone tell me what is the problem?

ntp.conf on server:

server prefer
fudge stratum 0

broadcast ttl 4

enable auth monitor
driftfile /var/ntp/ntp.drift
statsdir /var/ntp/ntpstats/
filegen peerstats file peerstats type day enable
filegen loopstats file loopstats type day enable
filegen clockstats file clockstats type day enable

keys /etc/inet/ntp.keys
trustedkey 0
requestkey 0
controlkey 0

ntp.conf on the client:

server x.x.x.x

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.


> driftfile /var/ntp/ntp.drift

Do you create "/var/ntp/ntp.drift" with "0.0" in it?

ebi168Author Commented:
What is the drift file used for? I created the ntp.drift file, run: /etc/init.d/xntpd start -c /etc/inet/ntp.conf

But the process is still not up.
Your config tends to suggest that you are trying to create a local master. I'd suggest using:

server prefer
fudge stratum 0

which is the IP assigned to the localhost interface.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Bootstrap 4: Exploring New Features

Learn how to use and navigate the new features included in Bootstrap 4, the most popular HTML, CSS, and JavaScript framework for developing responsive, mobile-first websites.

ebi168Author Commented:
I tried
server prefer
fudge stratum 0

It start working. So why instead

When I run ntpq, I got error on both server and client:

# ntpq
ntpq> peers
localhost: timed out, nothing received
***Request timed out

ebi168Author Commented:
What is a local master?
> So why instead

Because that IP is bound to the lo interface.
ebi168Author Commented:
Then what is a local master? With, what clock is the server sync to?

Why I am having problem using ntpq?

When you bind NTP to a local IP with a stratum of 0 instead of an Internet timekeeper you are creating a local master. That's useful when you don't have a full time Internet connection but still need all of the clients to have the same time. The clock may not be correct in the absolute sense, but they'll all be the same.

On the local master what does 'peers' with the server IP set to show now?
>>what clock is the server sync to?

For your local NTP master, you can get the correct time from a external host, eg, you
what your server to get the correct time from an external hosts (IP, you
can put something like the following in your crontab.

10 3,15 * * * /usr/sbin/ntpdate >/dev/null 2>&1

you local NTP clients will get time from your server.

ebi168Author Commented:
Both server and client still show:

localhost: timed out, nothing received
***Request timed out

yuzh: But isn't it that once you ran xntpd, you can't use ntpdate any longer.

Sorry, I didn't think, a memory bug in my head!

But you can create a startup script to run ntpdate before the system start to run

The proper way to do it is to allow this NTP server to synchronize with public time server.

Add one or more servers to  ntp.conf file, your server becomes a client of the refrence Server.

Have a look at the following FAQ:


for NTP server and client setup:
ebi168Author Commented:
Yuzh: thanks for all the links.

Does anyone know what is my problem with xntpd?


> ntpq> peers
> localhost: timed out, nothing received
> ***Request timed out

Do you have any firewall software (such IPF) running on your ntpd server?
Turn off the firewall first.

Also, can you provide the /etc/hosts and the output of "ifconfig -a"?

ebi168Author Commented:
How would firewall, /etc/hosts file and ifconfig -a matter?
/etc/hosts and "ifconfig -a" is getting some information to understand your network configuration.

Firewall on the host may block the ntpq.

ebi168Author Commented:
/>ifconfig -a
lo0: flags=1000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4> mtu 8232 index 1
        inet netmask ff000000
ge0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
        inet x.x.x.x netmask ff000000 broadcast
        ether 0:3:ba:b:42:e2
ge0:1: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
        inet y.y.y.y netmask ff000000 broadcast

x.x.x.x and y.y.y.y are the two ip address accessible to the server.

/etc/hosts are just all the ip addresses and host names pairs.

I need to research on how to find out whether the firewall is installed.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Unix OS

From novice to tech pro — start learning today.