2024-06-12 18:45:04 +01:00
|
|
|
---
|
|
|
|
id: 2w0e
|
|
|
|
title: Set DNS settings
|
|
|
|
tags: [Linux, networks]
|
|
|
|
created: Wednesday, June 12, 2024
|
|
|
|
---
|
|
|
|
|
|
|
|
# Set DNS settings
|
|
|
|
|
|
|
|
## Change the default DNS server
|
|
|
|
|
|
|
|
On Arch and most modern Linux distributions domain name resolution is handled
|
|
|
|
via the `systemd-resolved` #systemd configuration.
|
|
|
|
|
|
|
|
Within the system systemd files this will be handled in
|
2024-06-17 18:15:03 +01:00
|
|
|
`/etc/systemd/network/wired.network` or `/etc/systemd/network/wlan.network`
|
|
|
|
files etc.
|
2024-06-12 18:45:04 +01:00
|
|
|
|
|
|
|
In the file below I have turned of DHCP routing and specified the address of my
|
2024-06-17 20:00:04 +01:00
|
|
|
Pi-Hole device to handle domain name resolution:
|
2024-06-12 18:45:04 +01:00
|
|
|
|
|
|
|
```
|
|
|
|
#wlan.network
|
|
|
|
|
|
|
|
[Match]
|
|
|
|
Name=wl*
|
|
|
|
|
|
|
|
[Link]
|
|
|
|
RequiredForOnline=routable
|
|
|
|
|
|
|
|
[Network]
|
|
|
|
DHCP=yes
|
|
|
|
DNS=192.168.0.4
|
|
|
|
MulticastDNS=yes
|
|
|
|
|
|
|
|
[DHCPv4]
|
|
|
|
UseDNS=no
|
|
|
|
RouteMetric=600
|
|
|
|
|
|
|
|
[IPv6AcceptRA]
|
|
|
|
RouteMetric=600
|
|
|
|
|
|
|
|
```
|
|
|
|
|
2024-06-17 20:00:04 +01:00
|
|
|
This stops it using the default DNS server of my router and runs the resolutions
|
|
|
|
against Pi-Hole.
|
|
|
|
|
2024-06-12 18:45:04 +01:00
|
|
|
## Related notes
|
2024-06-17 20:00:04 +01:00
|
|
|
|
|
|
|

|
|
|
|

|