# OpenNTPD and IPv4 Only Kernel



## pacman2011 (Mar 28, 2013)

Howdy!

I have a custom kernel installed, that does NOT allow IPv6. I cannot change that, and everything works fine - except for OpenNTPD which dies on start (I believe this is due to a DNS IPv6 record issue related to this bug here). 


```
# /usr/local/etc/rc.d/openntpd start
Starting openntpd.
Lost child: child exited
Terminating
```


```
Mar 28 18:47:30 <ntp.info> ntpd[73382]: ntp engine ready
Mar 28 18:47:30 <ntp.crit>ntpd[73382]: fatal: client_query socket: Protocol not supported
Mar 28 18:47:30 <ntp.crit>ntpd[73383]: dispatch_imsg in main: pipe closed
```

I'm at the newest version of OpenNPTD (I think):

```
===>  Installing for openntpd-4.6_2,2
===>   Generating temporary packing list
===> Creating users and/or groups.
Using existing group `_ntp'.
Using existing user `_ntp'.
install  -s -o root -g wheel -m 555 /usr/ports/net/openntpd/work/ntpd/ntpd /usr/local/sbin
install  -o root -g wheel -m 444 /usr/ports/net/openntpd/work/ntpd/ntpd.conf.5 /usr/local/man/man5
install  -o root -g wheel -m 444 /usr/ports/net/openntpd/work/ntpd/ntpd.8 /usr/local/man/man8
install  -o root -g wheel -m 444 /usr/ports/net/openntpd/files/ntpd.conf /usr/local/share/examples/openntpd
===> Installing rc.d startup script(s)
===> Correct pkg-plist sequence to create group(s) and user(s)
===>   Compressing manual pages for openntpd-4.6_2,2
===>   Registering installation for openntpd-4.6_2,2
```

While the bug report (see above) says that it has been fixed....I don't believe it has as OpenNTPD still terminates for me.

Not sure where to go from here, aside from forcing myself to learn all the in's and out's of NTP and forcing it to use IPv4. Unfortunately I would rather not scrap the OpenNTPD thing (which I am a huge fan of). 

Any help is appreciated.

~Pacman


----------



## DutchDaemon (Mar 28, 2013)

Set the listen-on directive in /usr/local/etc/ntpd.conf to your explicit IPv4 address, example:


```
# Addresses to listen on (ntpd does not listen by default)
#listen on *
#listen on 127.0.0.1
#listen on ::1
listen on 192.168.2.1
```


----------



## pacman2011 (Mar 28, 2013)

DutchDaemon,

Thanks for the quick reply! This, however, is not the issue. I believe the issue to be that when the DNS records come back for the servers *I* want to sync to, they contain IPv6 addresses as well as IPv4. There are no IPv6 addresses in my /usr/local/etc/ntpd.conf file, reproduced below.


```
# Addresses to listen on (ntpd does not listen by default)
listen on 192.168.32.212
listen on 127.0.0.1

servers 0.us.pool.ntp.org
servers 1.us.pool.ntp.org
servers 2.us.pool.ntp.org
```

~Pacman


----------



## pacman2011 (Mar 28, 2013)

EDIT:

That DNS Stuff comes from the link *I* supplied in my first post, reproduced:

and the specific error *I* think *I* may be up against:


> on some machines the openntpd dies after random time. The machines have
> only ipv4 enabled, and strace give me this output:
> 
> ```
> ...



~Pacman


----------



## DutchDaemon (Mar 28, 2013)

For now, comment out 
	
	



```
servers 2.us.pool.ntp.org
```
 It seems to work fine with 0 and 1. Though 2 does not seem to contain IPv6 hosts.


----------



## pacman2011 (Apr 1, 2013)

Dutch,

I NEVER would have even thought to check that. I confirmed it works with any number and combination of (0, 1, 3, or 4).us.pool.ntp.org. How did you come across thinking of removing 2.us.pool.ntp.org? Also, a `dig` on that address returns no IPv6 (from an IPv6 enabled machine)


```
; <<>> DiG 9.7.6-P1 <<>> 2.us.pool.ntp.org
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 53175
;; flags: qr rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;2.us.pool.ntp.org.		IN	A

;; ANSWER SECTION:
2.us.pool.ntp.org.	150	IN	A	72.8.140.240
2.us.pool.ntp.org.	150	IN	A	69.50.219.51
2.us.pool.ntp.org.	150	IN	A	24.25.4.103
2.us.pool.ntp.org.	150	IN	A	108.61.56.35

;; Query time: 45 msec
;; SERVER: <REDACTED>
;; WHEN: Mon Apr  1 14:50:33 2013
;; MSG SIZE  rcvd: 99
```

Is it truly a IPv4 vs IPv6 enabled kernel problem? *O*r do you think there is something funny going on with 2.us.pool.ntp.org? I just want to avoid having this crop up again and me not notice it. 

Thanks a bunch!

~Pacman


----------



## DutchDaemon (Apr 1, 2013)

This was a classic example of 'just trying something and finding that it worked'. No other system or conclusion should be derived from that.


----------

