I'm using DHCP and have both IPv4 and IPv6. I want to run a script that updates an IPv6 DDNS service when my network is configured.
I created a script at /etc/network/if-up.d/update_dns however this script fails with a DNS resolution error ("curl: (6) Could not resolve host: dynv6.com"). The logs seem to show it's running before the IPv6 DHCP is finished. I think maybe this is because IPv4 is ready and the scripts fire.
Is there somewhere else I should put scripts that require IPv6? There are many answers that suggest if-up.d is the correct place?
I'm using Raspbian Jessie Lite, which already has the Slow Boot (a script at /etc/systemd/system/dhcpcd.service.d/wait.conf that waits for DHCP) which fixed similar issues previously with things running before the network was ready.
I've included logs of anything including network/dhcp/eth0 below.
Apr 6 20:49:58 raspberrypi systemd[1]: Starting LSB: Raise network interfaces....
Apr 6 20:49:58 raspberrypi networking[223]: Configuring network interfaces...* Hostname was NOT found in DNS cache
Apr 6 20:49:58 raspberrypi networking[223]: % Total % Received % Xferd Average Speed Time Time Time Current
Apr 6 20:49:58 raspberrypi networking[223]: Dload Upload Total Spent Left Speed
Apr 6 20:49:58 raspberrypi networking[223]: 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Could not resolve host: dynv6.com
Apr 6 20:49:58 raspberrypi networking[223]: * Closing connection 0
Apr 6 20:49:58 raspberrypi networking[223]: curl: (6) Could not resolve host: dynv6.com
Apr 6 20:49:58 raspberrypi networking[223]: done.
Apr 6 20:49:58 raspberrypi systemd[1]: Started LSB: Raise network interfaces..
Apr 6 20:49:58 raspberrypi systemd[1]: Starting dhcpcd on all interfaces...
Apr 6 20:49:58 raspberrypi dhcpcd[385]: version 6.7.1 starting
Apr 6 20:49:58 raspberrypi dhcpcd[385]: dev: loaded udev
Apr 6 20:49:58 raspberrypi dhcpcd[385]: eth0: adding address fe80::1073:c87:ef15:c4a3
Apr 6 20:49:58 raspberrypi dhcpcd[385]: eth0: waiting for carrier
Apr 6 20:49:58 raspberrypi dhcpcd[385]: wlan0: waiting for carrier
Apr 6 20:50:00 raspberrypi dhcpcd[385]: eth0: carrier acquired
Apr 6 20:50:00 raspberrypi dhcpcd[385]: DUID 00:01:00:01:1e:7e:75:f4:b8:27:eb:8c:48:b0
Apr 6 20:50:00 raspberrypi dhcpcd[385]: eth0: IAID eb:8c:48:b0
Apr 6 20:50:01 raspberrypi dhcpcd[385]: eth0: rebinding lease of 192.168.0.100
Apr 6 20:50:01 raspberrypi dhcpcd[385]: eth0: soliciting an IPv6 router
Apr 6 20:50:02 raspberrypi dhcpcd[385]: eth0: Router Advertisement from fe80::c23e:fff:fe63:5170
Apr 6 20:50:02 raspberrypi dhcpcd[385]: eth0: adding address fd41:6d80:6364:0:bcdf:ae43:354b:1e46/64
Apr 6 20:50:02 raspberrypi dhcpcd[385]: eth0: adding address 2a02:c7d:2bbb:9f00:76b3:47f9:2c11:fea4/64
Apr 6 20:50:02 raspberrypi dhcpcd[385]: eth0: adding route to fd41:6d80:6364::/64
Apr 6 20:50:02 raspberrypi dhcpcd[385]: eth0: adding route to 2a02:c7d:2bbb:9f00::/64
Apr 6 20:50:02 raspberrypi dhcpcd[385]: eth0: adding default route via fe80::c23e:fff:fe63:5170
Apr 6 20:50:02 raspberrypi dhcpcd[385]: eth0: requesting DHCPv6 information
Apr 6 20:50:06 raspberrypi dhcpcd[385]: eth0: leased 192.168.0.100 for 86400 seconds
Apr 6 20:50:06 raspberrypi dhcpcd[385]: eth0: adding route to 192.168.0.0/24
Apr 6 20:50:06 raspberrypi dhcpcd[385]: eth0: adding default route via 192.168.0.1
Apr 6 20:50:06 raspberrypi dhcpcd[385]: forked to background, child pid 716
Apr 6 20:50:06 raspberrypi systemd[1]: Started dhcpcd on all interfaces.
Apr 6 20:50:06 raspberrypi ntpd[757]: Listen normally on 3 eth0 192.168.0.100 UDP 123
Apr 6 20:50:06 raspberrypi ntpd[757]: Listen normally on 5 eth0 2a02:c7d:2bbb:9f00:76b3:47f9:2c11:fea4 UDP 123
Apr 6 20:50:06 raspberrypi ntpd[757]: Listen normally on 6 eth0 fe80::1073:c87:ef15:c4a3 UDP 123
Apr 6 20:50:06 raspberrypi ntpd[757]: Listen normally on 8 eth0 fd41:6d80:6364:0:bcdf:ae43:354b:1e46 UDP 123
