This repository was archived by the owner on Apr 3, 2025. It is now read-only.
Commit 602c435
committed
NM: Make DNS settings the maximum to avoid DNS leak fallback
NM has atrocious defaults. In the current situation, if you're
connected to OpenVPN/WireGuard (full tunnel, default gateway), DNS may
go outside of the VPN if the hostname only resolves in e.g. a DHCP
provided dns server. This is determined with the ipv4/ipv6
dns-priority setting and the dns-search setting.
We have to ensure that the dns-priority gets a negative value, from
nm-settings:
DNS servers priority. The relative priority for DNS servers specified
by this setting. A lower numerical value is better (higher
priority). Negative values have the special effect of excluding other
configurations with a greater numerical priority value; so in presence
of at least one negative priority, only DNS servers from connections
with the lowest priority value will be used. To avoid all DNS leaks,
set the priority of the profile that should be used to the most
negative value of all active connections profiles
We thus make the following change if full tunnel/default gateway:
- Set the DNS priority:
nmcli con modify eduVPN ipv4.dns-priority -2147483648 (int32 min)
nmcli con modify eduVPN ipv6.dns-priority -2147483648 (int32 min)
- Include the ~. DNS search domain:
nmcli con modify eduVPN ipv4.dns-search "~."
nmcli con modify eduVPN ipv6.dns-search "~."
Modifying the DNS search domain to ~. is needed according to
https://systemd.io/RESOLVED-VPNS/. This doc also states it's good to
set never-default to no (even if it doesn't do much), which we already
did for OpenVPN. Let's do the same for WireGuard.
Note that this only seems to happen with systemd-resolved which is the
default on Fedora. E.g. Openresolv resolvconf is not affected1 parent 52b7d08 commit 602c435
1 file changed
+35
-30
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
394 | 394 | | |
395 | 395 | | |
396 | 396 | | |
397 | | - | |
398 | | - | |
399 | 397 | | |
400 | | - | |
401 | | - | |
402 | | - | |
403 | 398 | | |
404 | 399 | | |
405 | 400 | | |
| |||
408 | 403 | | |
409 | 404 | | |
410 | 405 | | |
411 | | - | |
412 | | - | |
413 | | - | |
414 | | - | |
415 | | - | |
416 | | - | |
417 | | - | |
418 | | - | |
419 | | - | |
420 | | - | |
421 | | - | |
422 | | - | |
423 | | - | |
424 | | - | |
425 | | - | |
426 | | - | |
427 | | - | |
428 | | - | |
429 | | - | |
430 | | - | |
431 | | - | |
432 | | - | |
433 | 406 | | |
434 | 407 | | |
435 | 408 | | |
| |||
443 | 416 | | |
444 | 417 | | |
445 | 418 | | |
446 | | - | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
447 | 439 | | |
448 | 440 | | |
449 | 441 | | |
450 | 442 | | |
| 443 | + | |
451 | 444 | | |
452 | 445 | | |
453 | 446 | | |
| |||
517 | 510 | | |
518 | 511 | | |
519 | 512 | | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
520 | 522 | | |
521 | 523 | | |
522 | 524 | | |
523 | 525 | | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
524 | 529 | | |
525 | 530 | | |
526 | 531 | | |
| |||
586 | 591 | | |
587 | 592 | | |
588 | 593 | | |
589 | | - | |
| 594 | + | |
590 | 595 | | |
591 | 596 | | |
592 | 597 | | |
| |||
0 commit comments