Skip to content

Instantly share code, notes, and snippets.

View markusstoll's full-sized avatar

Markus Stoll markusstoll

  • junidas GmbH
  • Stuttgart, Germany
View GitHub Profile
@smammy
smammy / macOS-IPv6-Tunnel-DNS-HOWTO.md
Created December 13, 2018 19:14
How to convince macOS to do IPv6 DNS lookups when your only IPv6 address is via a VPN or tunnel of some sort

This was a huge hassle to figure out, so I wrote up a little guide in hopes that others would find it helpful:

How to convince macOS to do IPv6 DNS lookups when your only IPv6 address is via a VPN or tunnel of some sort

The Problem

macOS's domain name resolver will only return IPv6 addresses (from AAAA records) when it thinks that you have a valid routable IPv6 address. For physical interfaces like Ethernet or Wi-Fi it's enough to set or be assigned an IPv6 address, but for tunnels (such as those using utun interfaces) there are some extra annoying steps that need to be taken to convince the system that yes, you indeed have an IPv6 address, and yes, you'd like to get IPv6 addresses back for DNS lookups.

I use wg-quick to establish a WireGuard tunnel between my laptop and a Linode virtual server. WireGuard uses a utun user-space tunnel device to make the connection. Here's how that device gets configured:

Preparing

To prepare, turn off automatic builds in Eclipse (otherwise, Eclipse is going to be really, really "helpful" by creating folders, modifying .classpath etc.). Keep automatic builds off until you've at least finished step 2 (changing your configuration files.

Once you've changed the configuration files, close the project and open it again, then turn on the Eclipse builds again.

1. Creating folders and moving stuff around

Here are the modifications you have to do to your project's layout, expressed in bash (as if your working directory is your project's root).