[ANNOUNCE] Alpha Snapshots of WireGuard for Android and macOS

Jason A. Donenfeld Jason at zx2c4.com
Wed May 16 02:24:36 CEST 2018


On Wed, May 16, 2018 at 1:09 AM, Tim Sedlmeyer <sedlmeyer at gmail.com> wrote:
> MacOS users should be aware that if you have manually assigned DNS servers
> the current wg-quick implementation will remove them and not restore them.

Wow, that was fast. Indeed, from the source [1], see comment:

set_dns() {
    # TODO: this should use scutil and be slightly more clever. But for now
    # we simply overwrite any _manually set_ DNS servers for all network
    # services. This means we get into trouble if the user doesn't actually
    # want DNS via DHCP when setting this back to "empty". Because macOS is
    # so horrible to deal with here, we'll simply wait for irate users to
    # provide a patch themselves.
    local service response
    { read -r _; while read -r service; do
        [[ $service == "*"* ]] && service="${service:1}"
        while read -r response; do
            [[ $response == *Error* ]] && echo "$response" >&2
        done < <(cmd networksetup -setdnsservers "$service" "${DNS[@]}")
    done; } < <(networksetup -listallnetworkservices)
}

del_dns() {
    local service response
    { read -r _; while read -r service; do
        [[ $service == "*"* ]] && service="${service:1}"
        while read -r response; do
            [[ $response == *Error* ]] && echo "$response" >&2
        done < <(cmd networksetup -setdnsservers "$service" Empty)
    done; } < <(networksetup -listallnetworkservices)
}

If you'd like to contribute a patch to do this properly, please don't hesitate.

[1] https://git.zx2c4.com/WireGuard/tree/src/tools/wg-quick/darwin.bash


More information about the WireGuard mailing list