Files
linuxkit/alpine/packages/dnsfix/etc/init.d/dnsfix
Justin Cormack 4980c1a80e typo
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-02-17 14:11:13 +00:00

22 lines
451 B
Plaintext
Executable File

#!/sbin/openrc-run
# A few users have reported not being able to access the nameserver on OSX
# If a lookup fails, fall back to Google public nameserver
depend()
{
after networking
}
start()
{
[ -d /sys/bus/vmbus ] && exit 0
ebegin "Testing DNS resolution"
ifconfig eth0 2>&1 >/dev/null && \
(dig localhost 2>&1 > /dev/null || printf "nameserver 8.8.8.8\nnameserver 8.8.4.4\n" > /etc/resolv.conf)
eend $? "DNS fix failed"
}