1
0
Fork 0
knowledge-base/KB/Linux/Server/DNS.md

33 lines
685 B
Markdown
Raw Normal View History

2022-09-04 12:54:22 +00:00
---
creation date: 2022-01-08
2023-11-23 13:37:11 +00:00
tags: [note,linux,dns]
2022-09-04 12:54:22 +00:00
---
**Please use a local unbound which is even better!**
Start and enable
2023-03-29 16:16:29 +00:00
```shell
2022-09-04 12:54:22 +00:00
systemd-networkd
systemd-resolved
```
2024-12-09 19:19:31 +00:00
You probably want to force DNS in `/etc/systemd/resolved.conf`
```ini
[Resolve]
DNS=...
# keep this empty to fail resolving if primary DNS doesn't work
FallbackDNS=
```
**Only if you want to prevent any network manager to change DNS servers**, then execute `sudo chattr -i /etc/resolv.conf; sudo nano /etc/resolv.conf; sudo chattr +i /etc/resolv.conf` to insert the following content:
2022-09-04 12:54:22 +00:00
2023-03-29 16:16:29 +00:00
```shell
2022-09-04 12:54:22 +00:00
options timeout:1
nameserver 80.241.218.68
nameserver 46.182.19.48
nameserver 8.8.8.8
nameserver 1.1.1.1
```