-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck-dns-bits
More file actions
executable file
·61 lines (50 loc) · 1.73 KB
/
check-dns-bits
File metadata and controls
executable file
·61 lines (50 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/bash
#set -o errexit
main() {
local failures=0
cat /etc/resolv.conf
echo "----"
#cat /etc/network/interfaces
#echo "----"
host github.com
host s3-us-west-1.amazonaws.com
echo "ipv4 forwarding on host: $(sysctl net.ipv4.ip_forward)"
echo "ipv4 forwarding in docker: $(docker run -ti tutum/dnsutils sysctl net.ipv4.ip_forward)"
for try in 0 1 2 3; do
for nameserver in 8.8.8.8 8.8.4.4 1.1.1.1 1.0.0.1 169.254.169.254; do
for h in github.com s3-us-west-1.amazonaws.com; do
echo "in docker:"
if ! docker run -ti tutum/dnsutils dig +short "@${nameserver}" "${h}"; then
echo " x Failed to lookup ${h} via @${nameserver} (docker)"
docker run -ti tutum/dnsutils cat /etc/resolv.conf
# https://blog.stangroome.com/2017/08/16/beware-docker-and-sysctl-defaults-on-gce/
echo "ipv4 forwarding on host: $(sysctl net.ipv4.ip_forward)"
echo "ipv4 forwarding in docker: $(docker run -ti tutum/dnsutils sysctl net.ipv4.ip_forward)"
failures=$((failures + 1))
fi
sleep 60
done
done
done
if [[ "${failures}" -gt 0 ]]; then
echo "===> Had ${failures} failure(s)"
cat /etc/resolv.conf
exit 1
fi
echo "ipv4 forwarding on host: $(sysctl net.ipv4.ip_forward)"
echo "ipv4 forwarding in docker: $(docker run -ti tutum/dnsutils sysctl net.ipv4.ip_forward)"
echo "===> Much Success"
}
loop=1
while (( SECONDS < 2500 )); do
echo "SECONDS: $SECONDS"
main "${@}"
echo "finished loop ${loop} =========================================="
loop=$((loop + 1))
sleep 10
done
ls -la /etc/sysctl.d/
cat /etc/sysctl.d/99-gce.conf
echo ==========
cat /etc/sysctl.d/99-travis-disable-ipv6.conf
echo "Exiting 0 at $SECONDS"