NTP sync - host not found

Fresh 12.1 install, can’t get time to sync.

These lines are from Display Log in NTP settings:

22 Nov 10:28:08 ntpd[4124]: host name not found: montpelier.ilan.caltech.edu
22 Nov 10:28:13 ntpd[4124]: host name not found EAI_NODATA: uk.pool.ntp.org

And this is output of several related commands:

linux-ttm8:/home/stan # ntpdate -u 0.north-america.pool.ntp.org
Error resolving 0.north-america.pool.ntp.org: Name or service not known (-2)
22 Nov 10:32:49 ntpdate[4165]: Can't find host 0.north-america.pool.ntp.org: Name or service not known (-2)
22 Nov 10:32:49 ntpdate[4165]: no servers can be used, exiting
linux-ttm8:/home/stan # ntpdate -u uk.pool.ntp.org
Error resolving uk.pool.ntp.org: Name or service not known (-2)
22 Nov 10:33:25 ntpdate[4167]: Can't find host uk.pool.ntp.org: Name or service not known (-2)
22 Nov 10:33:25 ntpdate[4167]: no servers can be used, exiting
linux-ttm8:/home/stan # ping uk.pool.ntp.org
PING uk.pool.ntp.org (31.193.9.2) 56(84) bytes of data.
64 bytes from clock01.mnuk01.burstnet.eu (31.193.9.2): icmp_seq=1 ttl=51 time=281 ms
64 bytes from clock01.mnuk01.burstnet.eu (31.193.9.2): icmp_seq=2 ttl=51 time=281 ms
64 bytes from clock01.mnuk01.burstnet.eu (31.193.9.2): icmp_seq=3 ttl=51 time=279 ms
64 bytes from clock01.mnuk01.burstnet.eu (31.193.9.2): icmp_seq=4 ttl=51 time=279 ms
^C
--- uk.pool.ntp.org ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3001ms
rtt min/avg/max/mdev = 279.518/280.421/281.148/0.786 ms
linux-ttm8:/home/stan # hwclock --debug
hwclock from util-linux 2.20.1
Using /dev interface to clock.
Last drift adjustment done at 1321932313 seconds after 1969
Last calibration done at 1321932313 seconds after 1969
Hardware clock is on local time
Assuming hardware clock is kept in local time.
Waiting for clock tick...
...got clock tick
Time read from Hardware Clock: 2011/11/22 10:36:15
Hw clock time : 2011/11/22 10:36:15 = 1321932975 seconds since 1969
Tue 22 Nov 2011 10:36:15 AM ICT  -1.143830 seconds
linux-ttm8:/home/stan # 

Time is off by about fifteen minutes, most likely related to weird system freezes I had on this machine earlier and which haven’t been resolved but at least I was able to sync the clock on 11.4 and now I don’t know how to force the system to know the time:

NTP and downloading

On Tue, 22 Nov 2011 04:36:02 +0000, Stan Ice wrote:

> Time is off by about fifteen minutes, most likely related to weird
> system freezes I had on this machine earlier and which haven’t been
> resolved but at least I was able to sync the clock on 11.4 and now I
> don’t know how to force the system to know the time:

If it’s more than 17 minutes (1000 seconds), ntpd won’t sync because it
deems the time source to be ‘insane’.

ntpdate shouldn’t care, but you might try setting the clock closer to
the correct time using the ‘date’ command and then try the ntpdate
command. I just tried your first one and it adjusted the clock here on
my 12.1 box without an issue.

Jim


Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

Set clock manually to within 5 min, no effect on “host not found” errors on those two particular servers, both in ntpdate and in ntp display log. “Test server” button reports they are reachable and respond properly, however.

Another server I picked randomly, tick.ucla.edu, however, adjusted time with ntpdate. I put it into NTP serttings in Yast, let’s see if it works, display log so far has not reported anything.

On Tue, 22 Nov 2011 05:36:02 +0000, Stan Ice wrote:

> Set clock manually to within 5 min, no effect on “host not found” errors
> on those two particular servers, both in ntpdate and in ntp display log.
> “Test server” button reports they are reachable and respond properly,
> however.
>
> Another server I picked randomly, tick.ucla.edu, however, adjusted time
> with ntpdate. I put it into NTP serttings in Yast, let’s see if it
> works, display log so far has not reported anything.

Sounds like it was a name resolution error of some sort - but it looks
like you found a host that’s working. :slight_smile:

Jim


Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

It didn’t solve “Host not found” problem, however. If there’s something wrong with DNS resolver it might pop up in unexpected places. Yesterday, for example, I tried to install corefonts in wine and wget gave me host not found problem on sourceforge. I downloaded the installer manually but it’s just a workaround and I might not find one for each and every time DNS fails to resolve hosts.

Entering actual IP address, 143.210.16.201 for uk.pool.ntp.org, for example, works while ntpupdate -u uk.pool.ntp.org gives

“Error resolving pool.uk.ntp.org: Name or service not known (-2)”

Okay, there was a mistake in the previous post, actual output is like this:


linux-ttm8:/home/stan # ping uk.pool.ntp.org
PING uk.pool.ntp.org (82.113.154.206) 56(84) bytes of data.
64 bytes from 82.113.154.206 (82.113.154.206): icmp_seq=1 ttl=50 time=266 ms
64 bytes from 82.113.154.206 (82.113.154.206): icmp_seq=2 ttl=50 time=266 ms
^C
--- uk.pool.ntp.org ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1000ms
rtt min/avg/max/mdev = 266.020/266.147/266.275/0.531 ms
linux-ttm8:/home/stan # ntpdate -u uk.pool.ntp.org
Error resolving uk.pool.ntp.org: Name or service not known (-2)
23 Nov 09:18:44 ntpdate[19672]: Can't find host uk.pool.ntp.org: Name or service not known (-2)
23 Nov 09:18:44 ntpdate[19672]: no servers can be used, exiting
linux-ttm8:/home/stan # ntpdate -u 82.113.154.206
23 Nov 09:18:56 ntpdate[19674]: adjust time server 82.113.154.206 offset -0.007668 sec
linux-ttm8:/home/stan #

On Wed, 23 Nov 2011 02:16:03 +0000, Stan Ice wrote:

> It didn’t solve “Host not found” problem, however. If there’s something
> wrong with DNS resolver it might pop up in unexpected places.

That sounds like a DNS issue from your provider - you might try
temporarily trying something like Google’s DNS (8.8.8.8 as I recall) and
see if that makes the resolution issue go away.

Jim


Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

But why ping request gets resolved then? And I can open all these sites in my browser, too, especially sourceforge.

stan@linux-ttm8:~> wget http://sourceforge.net/projects/corefonts/files/the%20fonts/final/arial32.exe/download?use_mirror=cdnetworks-kr-2
asking libproxy about url 'http://sourceforge.net/projects/corefonts/files/the%20fonts/final/arial32.exe/download?use_mirror=cdnetworks-kr-2'
libproxy suggest to use 'direct://'
--2011-11-23 11:42:41--  http://sourceforge.net/projects/corefonts/files/the%20fonts/final/arial32.exe/download?use_mirror=cdnetworks-kr-2
Resolving sourceforge.net (sourceforge.net)... failed: Name or service not known.
wget: unable to resolve host address `sourceforge.net'
stan@linux-ttm8:~>


Finally, I stopped being stubborn and added Google DNS servers (8.8.8.8 and 8.8.4.4) and that solved the problem.

Stan Ice wrote:
> But why ping request gets resolved then? And I can open all these sites
> in my browser, too, especially sourceforge.

Some programs use different system calls to others to resolve addresses.
I don’t remember the details offhand but I presume there’s some
difference in how those calls work that’s biting you in some circumstances.

Like Dave said, some programs use different calls - it could be that nscd
has negatively cached the addresses being used by ntp but that other
programs are bypassing nscd and just querying DNS directly.

In any event, sounds like changing DNS providers solved the issue, and
that’s good news. Means it’s something with your provider and not your
system. :slight_smile:

Jim


Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C