Computer Network 2021FA coding assignment 1: DNS-Relay

拿到代码框架时我是欣喜的,不过这文档属于是试图把我激怒了orz,遇到关键部分就开始谜语人,现在TA都这么喜欢设卡的嘛,讲清楚不就好多了orz 无奈只能先DIY一下…

error handling note

DNS 配置错误临时解决方法

跑一个 DNS Demo 的时候似乎 /etc/resolv.conf 被改了,导致出现 DNS 无法解析的情况(dns_probe_finished_bad_config)

遂 Google 了下,都说是要重新弄一下 resolvconf,可我 check 了下我的Ubuntu 20.04 根本就没装这玩意,只能把阿里的公共 DNS 服务器先 hardcode 进 /etc/resolv.conf 里面暂时顶一波,暂时是因为这个 config 你做的任何 change 都会被 overwrite,所以只能算暂时顶一波,先连个网装个 resolvconf 再说。

根据 askubuntu 的 solution 应该这么办。https://askubuntu.com/questions/622470/dns-probe-finished-bad-config-error-in-ubuntu-14-04

sudo rm /etc/resolv.conf
sudo ln -s /run/resolvconf/resolv.conf /etc/resolv.conf
sudo resolvconf -u

Update:

刚才复现了一下,发现上面那个不work.下面这个 solution 是可以的。

https://blog.csdn.net/lsqtzj/article/details/115303059

colanora@colanora:~/GitHub/dns-relay/src$ sudo ln -sf /lib/systemd/systemd-resolved.service /etc/systemd/system/dbus-org.freedesktop.resolve1.service
colanora@colanora:~/GitHub/dns-relay/src$ sudo systemctl restart systemd-resolved.service
colanora@colanora:~/GitHub/dns-relay/src$ systemd-resolve --status
Global
       LLMNR setting: no                  
MulticastDNS setting: no                  
  DNSOverTLS setting: no                  
      DNSSEC setting: no                  
    DNSSEC supported: no            
    ...

Categories:

Updated: