from small one page howto to huge articles all in one place

search text in:

Other sites:

Last additions:
How to make X listen on port 6000

How to make X listen on port 6000






average rating: 1.5 (4 votes) (1=very good 6=terrible)

May, 25th 2007:
April, 26th 2007:
Apr, 10th. 2007:
Druckversion . pdf icon
You are here: Tutorials per portage category->net-misc->ntp

ntp is the Network Time Protocol suite.

Installing ntpd

First, make sure ntp/ntpdate are installed. The package is by default installed on Mandrake Linux and Redhat. If you do not have ntp installed you will find packages on your distributions install-cd(s).

On Gentoo Linux, install by typing --- emerge ntp

Configuration files for running ntp as daemon

ntpd manpage

Client Setup

Now, edit the following files:

--- /etc/ntp.conf

The only important thing is that the line contains server


--- server driftfile /etc/ntp/drift broadcastdelay 0.008 authenticate no ---

Make sure you add ntpd as a boot (init) service.

Gentoo Linux: `rc-update add ntpd default` , `/etc/init.d/ntpd start`

(LAN) Server setup

To run a ntp server to sync the clocks on your lan, edit

--- /etc/ntp.conf


--- server prefer server server

fudge stratum 10

driftfile /etc/ntp/drift broadcastdelay 0.008

authenticate no ---

fudge tells the server to pass on the correct time to the given network interface. stratum is the level of time servers, 10 being the lowest. You only need a higher number if you will be acting as a public internet timeserver with fast bandwidth.

It makes sence to add a few servers. Select the best as prefer

Make sure you add ntpd as a boot (init) service.

Gentoo Linux: `rc-update add ntpd default` , `/etc/init.d/ntpd start`


ntp uses port 123, both UDP and TCP. Make sure this port is not blocked by a firewall.

If you are using iptables, you can open this port with

--- $IPTABLES -A INPUT -j ACCEPT -p tcp --dport 123

Known valid and working ntp servers

server adress Location IPV6 ONLY
server Norway
server Norway

Server List

Setting the clock at boot or using cron

I good idea is _not_ to run the ntpd daemon on clients as it uses about 1,7 MB memory, unless you are a server or have a box with a broken clock. Many boxes clocks do drift along on their own, a check every hour or day is generally a good idea.


rdate is a simple 3 kB tool for syncing the system clock to a server. It's options are `-p` to print the date on the given server, `-s` to set the system clock according to it (must be done as root) and `-u` to use the UDP protocol. Example:

`rdate -p`

rdate manual page


clockspeed is a very small tool for setting the clock and is, for clients, a much better alternative than installing the 4+ MB ntp package.

cron & ntp

You can simply add ntpdate as a cron job every now and then:

--- echo 'ntpdate -b' > /etc/cron.hourly/time.cron --- chmod a+x /etc/cron.hourly/time.cron

Most distributions come with a cron. dcron and Vixie cron are nice.

Gentoo & ntp-client

You can set the clock using ntp at boot (without starting the daemon) on Gentoo Linux by editing:

--- /etc/conf.d/ntp-client

The file should contain:

--- NTPDATE_CMD="ntpdate" NTPDATE_OPTS="-b" ---

Then add ntp-client to the services started at boot:

--- rc-update add ntp-client default

You can check what services are started at boot with `rc-status`.

Page source:

Copyright (c) 2000-2004 Øyvind Sæther. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".


Other free services
Shorten long
URLs to short
links like
Reverse DNS lookup
Find out which hostname(s)
resolve to a
given IP or other hostnames for the server

New Packages

- as rdf newsfeed
- as rss newsfeed
- as Atom newsfeed
rdf newsfeed | rss newsfeed | Atom newsfeed
- Powered by LeopardCMS - Running on Gentoo -
Copyright 2004-2018 Sascha Nitsch Unternehmensberatung UG(haftungsbeschänkt)
Valid XHTML1.1 : Valid CSS : buttonmaker
- Level Triple-A Conformance to Web Content Accessibility Guidelines 1.0 -
- Copyright and legal notices -
Time to create this page: 10.3 ms