Solved How to fix ntpd_initres: host name not found

upload_2015-1-1_12-11-38.png
 
Generally, this means DNS is not working. Sometimes it happens if ntpd(8) is started before the network is up. If you can ping those hostnames by hand, then DNS is working now. Is your network interface given an IP address with DHCP or statically?
 
My network interface is given an IP address with DHCP. I can't ping this hostname by hand.

Code:
[CMD]ping -c 3 de.pool.ntp.org[/CMD]
ping: cannot resolve de.pool.ntp.org: Host name look up failure
 
The DHCP server is supposed to hand out DNS server addresses which are written into /etc/resolv.conf.

What network card do you have? In case the card is slow to come up, let's first set it to wait for the DHCP response in /etc/resolv.conf, like:
Code:
ifconfig_re0="SYNCDHCP"
 
I already wrote this code in rc.conf but I added it also in resolv.conf and the problem still exists.
 
It does not go in /etc/resolv.conf, that file should only list the nameservers. So we are not guessing at this, please show the contents of your /etc/rc.conf and /etc/resolv.conf.
 
So it's a system with two interfaces that is supposed to be running a local DNS server. From that output, we can't tell what address DHCP provided, or whether it set the DNS server to 127.0.0.1.

There must be upstream DNS servers somewhere. I would start by using those. Once that works, add a local DNS server (unbound(8)).
 
I don't understand what you ask me to do.
Where and how I should look for upstream DNS servers.
What do you mean when you say "start by using those" and how I check if this works.

I have just one interface em0.

shabbat shalom (in hebrew) :)
 
Unbound does not need upstream DNS forwarders since it can do the queries itself to the authoritative nameservers. It is however more resource efficient to use forwarders if your ISP offers them.

The problem here as far as I can see is that Unbound takes a few moment to become fully operational and ntpd(8) starts querying the DNS forwarder specified in /etc/resolv.conf (127.0.0.1) a bit too soon. I'm seeing similar warnings on my system allthough I'm using the port version of Unbound, dns/unbound. They are harmless though because ntpd(8) will try again after some time and the name resolution should be operational by that time.
 
Oh and one question. Do you really need to use local_unbound(8) on the system? It's not terribly useful unless you have a busy server application running on the system that needs to do constant DNS lookups. You could just as well use let the system use the DNS forwarders it gets from DHCP if your use case is less demanding.
 
Where and how I should look for upstream DNS servers.

Your ISP should provide DNS servers. If the ISP uses DHCP, the DNS server addresses should be supplied by it and will show up in /etc/resolv.conf. Otherwise, you might have to ask the ISP and enter those addresses manually in /etc/resolv.conf.
 
Try each of these and show what is failing.

Check if the unbound(8) running on your local machine is working. Based off what you are seeing and the ping failing, this may not work.
drill @127.0.0.1 de.pool.ntp.org

Check if your LAN DNS is up. If you disable unbound(8) then /etc/resolv.conf will refer to this address for DNS.
drill @192.168.1.1 de.pool.ntp.org

Check if you have general internet connectivity and can get DNS from a public server.
drill @8.8.8.8 de.pool.ntp.org
 
Thanks for god and thanks to you guys(wblock@, kpa, junovitch) for your help, the problem is gone, I call to my ISP to receive the DNS server and I enter them to resolv.conf file and now it works.
 
I seem to be having the same problem on a FreeBSD guest inside VMware. I ran all of these commands:
drill @127.0.0.1 de.pool.ntp.org
drill @192.168.1.1 de.pool.ntp.org
drill @8.8.8.8 de.pool.ntp.org

The first one gives a rcode: SERVFAIL. But the rest work.

A ping gives me the following: (freebsd.pool.ntp.org instead of de.pool.ntp.org in my case)
ping.png


And my resolve.conf is:
resolv.conf.png
 
In resolve.conf I commented
Code:
nameserver 127.0.0.1
and uncommented
Code:
nameserver 192.168.186.2
. And that seemed to have solved my problem.
 
Using 127.0.0.1 as the first nameserver only works if the local system is running a DNS server. It should not be added routinely.
 
Back
Top