Skip to content

Commit 2a413ab

Browse files
ararslanstaticfloat
authored andcommitted
Reconfigure DNS resolution on FreeBSD VMs
We've been experiencing a failure in Julia's Downloads tests on FreeBSD, reproducible only in our VMs: the request to https://domain.invalid hits the 30-second timeout set by default in Downloads because it takes a full 30 seconds for the resolver to report `NXDOMAIN`. I have no idea why, and I can't even reproduce it in a FreeBSD VM on my local machine. Absent a real fix, we can apply a band-aid in the meantime: prefer Google's nameserver in the DNS resolver configuration. In the debugging VM on amdci6, this allows the Downloads tests to pass succesfully.
1 parent 8be096b commit 2a413ab

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

freebsd-kvm/buildkite-worker/kvm_machine.pkr.hcl.template

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ build {
7272
"setup_scripts/install-telegraf.sh",
7373
"setup_scripts/install-more-dependencies.sh",
7474
"setup_scripts/install-cryptic-secrets.sh",
75+
"setup_scripts/configure-dns-resolver.sh",
7576
]
7677
}
7778
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/sh
2+
set -e
3+
# The nameserver set by DHCP is the host machine's IP. For whatever reason, it takes
4+
# a full 30 seconds to report NXDOMAIN for invalid domains, which interacts poorly
5+
# with Julia's Downloads tests, which set a timeout. There are a few complementary ways
6+
# we could paper over this, among them:
7+
# - Use Google's DNS server, 8.8.8.8, either before or after the host. The former is
8+
# significantly faster.
9+
# - Reduce the amount of time the resolver waits for a response, e.g. `timeout:1` to
10+
# wait only 1 second. The default is 5 seconds, with exponential backoff.
11+
# - Reduce the number of times the resolver sends a query to each nameserver, e.g.
12+
# `attempts:1` to give up after a single query to each nameserer. Default is 2.
13+
# We'll only do the first of these as the resolver option changes could potentially
14+
# make things less robust to brief network hiccups.
15+
cat > /etc/resolvconf.conf <<EOF
16+
prepend_nameservers=8.8.8.8
17+
EOF
18+
resolvconf -u

0 commit comments

Comments
 (0)