pirate / wireguard-docs

📖 Unofficial WireGuard Documentation: Setup, Usage, Configuration, and full example setups for VPNs supporting both servers & roaming clients.
https://docs.sweeting.me/s/wireguard
MIT License
4.57k stars 316 forks source link

[Interface] DNS description incorrect #44

Open shuffle2 opened 4 years ago

shuffle2 commented 4 years ago

https://github.com/pirate/wireguard-docs/blob/master/README.md#dns-2

Currently it is described as if the setting will be somehow pushed/shared with peers. This is not the case. Instead, DNS servers listed in this key will just be populated on the local interface.

pirate commented 4 years ago

Aha good to know, does wg do DHCP at all to assign IPs when clients have a range in AllowedIps, or do clients all self-assign their own?

shuffle2 commented 4 years ago

wg doesn't do any dhcp itself. The config file only configures your local wg interface, and how your local wg client views other peers (this is why configs on both sides need to agree on settings, and settings local to each peer are what that peer actually uses to filter/route traffic)

cocoon commented 1 year ago

And it is missing the case that you can add a searchdomain.

See parsing of the go-client:

https://git.zx2c4.com/wireguard-windows/tree/conf/parser.go#n231

case "dns":
                addresses, err := splitList(val)
                if err != nil {
                    return nil, err
                }
                for _, address := range addresses {
                    a, err := netip.ParseAddr(address)
                    if err != nil {
                        conf.Interface.DNSSearch = append(conf.Interface.DNSSearch, address)
                    } else {
                        conf.Interface.DNS = append(conf.Interface.DNS, a)
                    }
                }

Override DNS for Specific Domains

For example, if the resolver’s IP address is 10.0.0.2, and the domain name is internal.example.com, you might normally use the following DNS settting:

DNS = 10.0.0.2, internal.example.com