Skip to content

Commit 12c07fc

Browse files
committed
Fix generic/ubuntu dns
lavabit/robox#54
1 parent 26df8d0 commit 12c07fc

File tree

2 files changed

+51
-1
lines changed

2 files changed

+51
-1
lines changed

Vagrantfile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,17 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
4848
apt-get update -y
4949
apt-get install -y git vim curl build-essential openssh-server
5050
apt-get install -y jq open-iscsi nfs-common
51-
51+
5252
echo "export CRI_CONFIG_FILE=/var/lib/rancher/rke2/agent/etc/crictl.yaml" >> /root/.bashrc
5353
echo "export PATH=$PATH:/var/lib/rancher/rke2/bin" >> /root/.bashrc
5454
SHELL
5555

56+
config.vm.provision "net",
57+
type: "shell",
58+
path: "scripts/fix.generic-ubuntu-dns.sh",
59+
privileged: true,
60+
run: "always"
61+
5662
# Server node
5763
config.vm.define "#{server_hostname}" do |node|
5864
node.vm.hostname = "#{server_hostname}"

scripts/fix.generic-ubuntu-dns.sh

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/bin/bash
2+
# see:
3+
# https://github.com/lavabit/robox/issues/11
4+
# https://github.com/lavabit/robox/issues/54
5+
6+
# exit if we are not on modern ubuntu version
7+
test -d /etc/netplan || exit 0
8+
9+
# Reset netplan config, not really needed; just to clearly indicate no fixed dns is used
10+
tee <<EOF > /etc/netplan/01-netcfg.yaml
11+
network:
12+
version: 2
13+
renderer: networkd
14+
ethernets:
15+
eth0:
16+
dhcp4: true
17+
dhcp6: false
18+
optional: true
19+
nameservers:
20+
addresses: []
21+
EOF
22+
netplan generate
23+
systemctl restart systemd-networkd.service
24+
systemctl restart ifplugd.service
25+
26+
# Remove fixed DNS entries and disable DNSSEC, disable flaky caching, or emdns
27+
tee <<EOF > /etc/systemd/resolved.conf
28+
[Resolve]
29+
DNS=
30+
FallbackDNS=
31+
Domains=
32+
#LLMNR=no
33+
#MulticastDNS=no
34+
DNSSEC=no
35+
Cache=no
36+
DNSStubListener=yes
37+
EOF
38+
39+
systemctl daemon-reload
40+
systemctl restart systemd-resolved
41+
42+
echo "Fixed networking."
43+
44+
# verify with: systemd-resolve --status

0 commit comments

Comments
 (0)