Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start using dnsmasq as the initial dns server #1196

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 12 additions & 3 deletions rhizome/host/lib/vm_setup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -404,17 +404,26 @@ def cloudinit(unix_user, public_key, nics, swap_size_bytes)
end.join("\n")

raparams = nics.map { "ra-param=#{_1.tap}" }.join("\n")

interfaces = nics.map { "interface=#{_1.tap}" }.join("\n")
dnsmasq_address_ip6 = NetAddr::IPv6Net.parse(nics.first.net6).nth(3)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it more customary to put this at the customary gateway address as well, e.g. ::1? To avoid too many "odd" addresses in the customer's prefix.

Copy link
Collaborator

@fdr fdr Feb 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Differently, is another viable option to pick a ULA prefix of some sort (or even get a public one from RIPE/ARIN) and put the DNS server in there? Since we control the route tables anyway, all we really would like is an address that does not conflict, right? Or does it it need to be in-prefix for some reason?

There are some ramifications on how the user experiences split horizon DNS with multiple interfaces, so this isn't a prescription, more like, do we have to think about that or is it foreclosed by other restrictions?

vp.write_dnsmasq_conf(<<DNSMASQ_CONF)
pid-file=
leasefile-ro
enable-ra
dhcp-authoritative
domain-needed
bogus-priv
no-resolv
#{raparams}
#{interfaces}
dhcp-range=#{guest_network.nth(2)},#{guest_network.nth(2)},#{guest_network.netmask.prefix_len}
#{private_ip_dhcp}
dhcp-option=option6:dns-server,2620:fe::fe,2620:fe::9
dhcp-option=option:dns-server,149.112.112.112,9.9.9.9
server=149.112.112.112
server=9.9.9.9
server=2620:fe::fe
server=2620:fe::9
dhcp-option=option6:dns-server,#{dnsmasq_address_ip6}
listen-address=#{dnsmasq_address_ip6}
dhcp-option=26,1400
DNSMASQ_CONF

Expand Down