wireguard-docs icon indicating copy to clipboard operation
wireguard-docs copied to clipboard

[Interface] DNS description incorrect

Open shuffle2 opened this issue 4 years ago • 3 comments

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.

shuffle2 avatar Apr 23 '20 19:04 shuffle2

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?

pirate avatar May 01 '20 05:05 pirate

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)

shuffle2 avatar May 02 '20 06:05 shuffle2

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

cocoon avatar Jul 30 '23 06:07 cocoon