Skip to content

Commit 8c78a73

Browse files
refine Fedora DNS configuration guide for clarity and consistency
1 parent 1d17a8d commit 8c78a73

File tree

1 file changed

+86
-90
lines changed

1 file changed

+86
-90
lines changed
Lines changed: 86 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -1,170 +1,166 @@
1-
# Fedora DNS Configuration: Forcing Specific DNS Server
1+
# Fedora DNS Configuration: Forcing a Specific DNS Server
22

33
## Problem
44

5-
Fedora system configured to use a specific DNS server (e.g., AdGuard, Pi-hole) for IPv4, but systemd-resolved was falling back to the router's DNS via IPv6 DHCPv6 advertisements.
5+
A Fedora system was configured to use a specific IPv4 DNS server (e.g., AdGuard, Pi-hole), but systemd-resolved still used the router’s IPv6 DNS advertised via DHCPv6/SLAAC.
66

7-
## Diagnosis Commands
7+
## Diagnosis
88

9-
### Check Current DNS Configuration
9+
### Check Active DNS
1010

1111
```bash
1212
resolvectl status
1313
```
1414

15-
This shows which DNS servers are currently being used and where they come from.
16-
17-
### Identify IPv6 Link-Local Address
18-
19-
If you see an IPv6 link-local address (starts with `fe80::`) and want to find its corresponding IPv4:
15+
### Inspect Neighbor Tables
2016

2117
```bash
22-
# Show IPv6 neighbors with their MAC addresses
2318
ip -6 neigh show dev <interface>
24-
25-
# Show IPv4 neighbors with their MAC addresses
2619
ip neigh show
27-
28-
# Find specific device by MAC address
2920
ip neigh show | grep <mac-address>
3021
```
3122

32-
### Check NetworkManager Connection Settings
23+
### Inspect NetworkManager Connection
3324

3425
```bash
35-
# List all connections
3626
nmcli connection show
37-
38-
# View detailed connection settings
3927
nmcli connection show "<connection-name>"
4028
```
4129

42-
Look for these key settings:
43-
- `ipv4.dns` - Your configured IPv4 DNS
44-
- `ipv6.method` - How IPv6 is configured (auto/manual/disabled)
45-
- `ipv6.ignore-auto-dns` - Whether to ignore router-provided DNS
46-
- `IP6.DNS[1]` - Currently active IPv6 DNS
30+
Key fields:
4731

48-
## Root Cause
32+
* `ipv4.dns`
33+
* `ipv6.method`
34+
* `ipv6.ignore-auto-dns`
35+
* `IP6.DNS[1]`
4936

50-
When `ipv6.method` is set to `auto`, the router can advertise its own DNS server via DHCPv6/SLAAC. systemd-resolved may prioritize this over manually configured IPv4 DNS.
37+
## Root Cause
5138

52-
## Solution
39+
With `ipv6.method=auto`, the router may supply its own DNS via DHCPv6. systemd-resolved may prefer it over the manually configured IPv4 DNS.
5340

54-
### Recommended: Ignore Auto-Configured IPv6 DNS
41+
## Fix
5542

56-
Keep IPv6 working but ignore DNS from router advertisements:
43+
### Ignore Auto-Provided IPv6 DNS (recommended)
5744

5845
```bash
59-
nmcli connection modify <connection-name> ipv6.ignore-auto-dns yes
60-
nmcli connection up <connection-name>
46+
nmcli connection modify <connection> ipv6.ignore-auto-dns yes
47+
nmcli connection up <connection>
6148
```
6249

63-
### Verify the Fix
50+
### Verify
6451

6552
```bash
6653
resolvectl status
6754
```
6855

69-
Check that only your desired DNS server is listed as "Current DNS Server".
70-
71-
## Alternative Solutions
56+
## Alternatives
7257

73-
### Option 1: Set IPv6 DNS Explicitly
74-
75-
If your DNS server has an IPv6 address:
58+
### Explicit IPv6 DNS
7659

7760
```bash
78-
nmcli connection modify <connection-name> ipv6.dns "<ipv6-address>"
79-
nmcli connection modify <connection-name> ipv6.ignore-auto-dns yes
80-
nmcli connection up <connection-name>
61+
nmcli connection modify <connection> ipv6.dns "<ipv6-address>"
62+
nmcli connection modify <connection> ipv6.ignore-auto-dns yes
63+
nmcli connection up <connection>
8164
```
8265

83-
### Option 2: IPv6 Link-Local Only
84-
85-
Keep basic IPv6 connectivity without DHCPv6:
66+
### IPv6 Link-Local Only
8667

8768
```bash
88-
nmcli connection modify <connection-name> ipv6.method link-local
89-
nmcli connection up <connection-name>
69+
nmcli connection modify <connection> ipv6.method link-local
70+
nmcli connection up <connection>
9071
```
9172

92-
### Option 3: Disable IPv6 Completely
93-
94-
If IPv6 is not needed:
73+
### Disable IPv6
9574

9675
```bash
97-
nmcli connection modify <connection-name> ipv6.method disabled
98-
nmcli connection up <connection-name>
76+
nmcli connection modify <connection> ipv6.method disabled
77+
nmcli connection up <connection>
9978
```
10079

101-
### Option 4: Configure Router
80+
### Configure Router
10281

103-
Configure your router to advertise your preferred DNS server in IPv6 router advertisements instead of itself.
82+
Adjust router RAs to advertise your preferred IPv6 DNS.
10483

105-
## Testing Commands
84+
## Testing
10685

107-
### Test DNS Server Connectivity
86+
### Connectivity
10887

10988
```bash
110-
# Test IPv4 DNS server
111-
ping -c 2 <dns-server-ip>
112-
113-
# Test IPv6 link-local (requires interface specification)
89+
ping -c 2 <dns-ip>
11490
ping -c 2 <ipv6-address>%<interface>
11591
```
11692

117-
### Test DNS Resolution
93+
### Resolution
11894

11995
```bash
120-
# Query a domain
12196
nslookup google.com
122-
123-
# Or use dig for more details
12497
dig google.com
125-
126-
# Check which DNS server resolved the query
12798
resolvectl query google.com
12899
```
129100

130-
### Check Network Neighbor Tables
101+
### Neighbor Tables
131102

132103
```bash
133-
# View all IPv4 neighbors (ARP table)
134104
ip neigh show
135-
136-
# View all IPv6 neighbors (NDP table)
137105
ip -6 neigh show
138-
139-
# View neighbors on specific interface
140106
ip neigh show dev <interface>
141107
ip -6 neigh show dev <interface>
142108
```
143109

144110
## Quick Reference
145111

146-
| Command | Purpose |
147-
|---------|---------|
148-
| `resolvectl status` | Show current DNS configuration |
149-
| `nmcli connection show` | List NetworkManager connections |
150-
| `nmcli connection show "<name>"` | View connection details |
151-
| `ip neigh show` | Show IPv4 neighbor table |
152-
| `ip -6 neigh show` | Show IPv6 neighbor table |
153-
| `nmcli connection modify <name> ipv6.ignore-auto-dns yes` | Ignore router DNS |
154-
| `nmcli connection up <name>` | Apply connection changes |
155-
| `ping <address>` | Test connectivity |
156-
| `nslookup <domain>` | Test DNS resolution |
112+
| Command | Purpose |
113+
| --------------------------------------------------------- | ---------------------- |
114+
| `resolvectl status` | Show DNS configuration |
115+
| `nmcli connection show` | List connections |
116+
| `nmcli connection modify <name> ipv6.ignore-auto-dns yes` | Ignore router DNS |
117+
| `ip neigh show` / `ip -6 neigh show` | View ARP/NDP neighbors |
157118

158119
## Common Scenarios
159120

160-
### Scenario 1: Router Overriding DNS via IPv6
161-
**Symptom:** Custom DNS configured but router's DNS is being used
162-
**Fix:** `nmcli connection modify <name> ipv6.ignore-auto-dns yes`
121+
### Router Overriding DNS
122+
123+
Fix:
124+
125+
```bash
126+
nmcli connection modify <name> ipv6.ignore-auto-dns yes
127+
```
163128

164-
### Scenario 2: Want to Use IPv6 DNS
165-
**Symptom:** DNS server has IPv6 but not configured
166-
**Fix:** Set `ipv6.dns` and enable `ipv6.ignore-auto-dns`
129+
### Need IPv6 DNS
167130

168-
### Scenario 3: Don't Need IPv6
169-
**Symptom:** IPv6 causing DNS issues
170-
**Fix:** Set `ipv6.method disabled`
131+
Set `ipv6.dns` and ignore auto DNS.
132+
133+
### IPv6 Not Needed
134+
135+
Disable IPv6 entirely.
136+
137+
## Setting DNS with NetworkManager
138+
139+
### IPv4
140+
141+
```bash
142+
nmcli connection modify <connection> ipv4.dns "8.8.8.8 8.8.4.4"
143+
nmcli connection up <connection>
144+
```
145+
146+
### IPv6
147+
148+
```bash
149+
nmcli connection modify <connection> ipv6.dns "2001:4860:4860::8888"
150+
nmcli connection up <connection>
151+
```
152+
153+
### Prevent DHCP Overrides
154+
155+
```bash
156+
nmcli connection modify <connection> ipv4.ignore-auto-dns yes
157+
nmcli connection modify <connection> ipv6.ignore-auto-dns yes
158+
nmcli connection up <connection>
159+
```
160+
161+
### Find Connection Name
162+
163+
```bash
164+
nmcli connection show
165+
nmcli connection show --active
166+
```

0 commit comments

Comments
 (0)