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

Disable Landrush DNS Resolver in Parallels #1421

Merged

Conversation

craigpearson
Copy link
Contributor

Issue this fixes

Specific to the following configuration:

  • HEAD Trellis
  • Parallels as a provisioner
  • Multisite subdomains enabled and Landrush used as DNS resolver

Without this change, when provisioning the above this will fail. Due to the attempt of Landrush attempting to being the DNS resolver for guest. For more information: https://discourse.roots.io/t/no-dns-resolution-in-development-vm-vagrant-parallels-multisite-landrush/23170

Specifically Landrush will attempt to change IP Tables and internal DNS on the vagrant machine, upon attempting this communication to services such as APT and any outside connections will fail. This is due to Parallels differing in network adapters created. Parallels by default wlll configure a shared adapter for NAT / DNS resolution. And a secondary adapter for the custom IP we specify. Landrush not knowing that DNS is handled that way will therefore break DNS/NAT.

Credit to this fix is all on @Twansparant

The current addition adds a conditional to Parallels provisioner, however if double nested if statements are okay, we could move this up to the block below, and instead check if the current provisioner is Parallels and prefer Landrush config grouping:

trellis/Vagrantfile

Lines 60 to 62 in e9e7c37

config.landrush.enabled = true
config.landrush.tld = trellis_config.site_hosts_canonical.reject { |host| host.end_with?(".#{main_hostname}") }
hostnames.each { |host| config.landrush.host host, vconfig.fetch('vagrant_ip') }

@swalkinshaw
Copy link
Member

Great debugging 🚀 I can't really test this myself so I'll trust it works based on the Discourse thread 😄

@swalkinshaw swalkinshaw merged commit 7e8e241 into roots:master Aug 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants