Skip to content

Commit b246f14

Browse files
committed
add guide to change the resolv.conf
1 parent 34f9f5e commit b246f14

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# 科学上网
44

55
作者:左耳朵 [http://coolshell.cn](http://coolshell.cn)
6-
更新时间:2022-12-21
6+
更新时间:2023-02-02
77

88
这篇文章可以写的更好,欢迎到 [https://github.com/haoel/haoel.github.io](https://github.com/haoel/haoel.github.io) 更新
99

@@ -809,6 +809,19 @@ nameserver 172.20.1.1 #<--- 透明网关 EC2 NAT 实例
809809
nameserver 172.20.0.2 #<--- AWS 的 DNS 服务
810810
search [zone].compute.internal
811811
```
812+
> Note
813+
>
814+
> 新版的 Ubuntu 已经把 DNS Resolver 托管给了 systemd 的 `systemd-resolved` 服务,所以需要把 `/etc/resolv.conf` 文件改成软链接,指向 `systemd-resolved` 的配置文件,如:
815+
>
816+
> ```bash
817+
> sudo ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf
818+
> ```
819+
>
820+
> 然后,在 `/etc/systemd/resolved.conf` 文件中,把 `DNS``Domains` 配置项加上,如:
821+
>
822+
> ```conf
823+
> DNS=172.20.0.2
824+
> ```
812825
813826
### 8.4 私有子网中的 Kubernetes
814827

0 commit comments

Comments
 (0)