为什么DNS解析在带有--privileged = true标志的podman内部失败

时间:2019-11-19 07:16:53

标签: dns podman

我正在用root运行podman。我发现/etc/resolv.conf为空。因此在其中添加了名称服务器8.8.8.8。

root@e5cbef35b7d2:/run/resolvconf# cat /etc/resolv.conf
nameserver 8.8.8.8

现在,当我能够卷曲或挖掘google.com或ubuntu.com时。

root@e5cbef35b7d2:/run/resolvconf# dig http://ppa.launchpad.net/nginx/stable/ubuntu

; <<>> DiG 9.10.3-P4-Ubuntu <<>> http://ppa.launchpad.net/nginx/stable/ubuntu
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 11922
;; flags: qr rd ra ad; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;http://ppa.launchpad.net/nginx/stable/ubuntu. IN A

;; AUTHORITY SECTION:
.           86393   IN  SOA a.root-servers.net. nstld.verisign-grs.com. 2019111900 1800 900 604800 86400

;; Query time: 71 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Tue Nov 19 07:07:42 UTC 2019
;; MSG SIZE  rcvd: 148

但是当我运行apt-get update时。 它无法解析任何存储库。

root@e5cbef35b7d2:/run/resolvconf# apt-get update
Err:1 http://us.archive.ubuntu.com/ubuntu xenial-updates InRelease
  Temporary failure resolving 'us.archive.ubuntu.com'
Err:2 http://ppa.launchpad.net/openjdk-r/ppa/ubuntu xenial InRelease
  Temporary failure resolving 'ppa.launchpad.net'
Err:3 http://nginx.org/packages/ubuntu xenial InRelease
  Temporary failure resolving 'nginx.org'
Err:4 http://apt.postgresql.org/pub/repos/apt xenial-pgdg InRelease
  Temporary failure resolving 'apt.postgresql.org'
Err:5 http://apt.postgresql.org/pub/repos/apt utopic-pgdg InRelease
  Temporary failure resolving 'apt.postgresql.org'
Err:6 http://us.archive.ubuntu.com/ubuntu xenial InRelease
  Temporary failure resolving 'us.archive.ubuntu.com'
Err:7 http://cfengine.com/pub/apt/packages stable InRelease
  Temporary failure resolving 'cfengine.com'
Err:8 http://ppa.launchpad.net/nginx/stable/ubuntu xenial InRelease
  Temporary failure resolving 'ppa.launchpad.net'
Err:9 https://artifacts.elastic.co/packages/5.x/apt stable InRelease
  Could not resolve host: artifacts.elastic.co
Err:10 https://download.docker.com/linux/ubuntu xenial InRelease
  Could not resolve host: download.docker.com
Reading package lists... Done
W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/xenial-updates/InRelease  Temporary failure resolving 'us.archive.ubuntu.com'
W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/xenial/InRelease  Temporary failure resolving 'us.archive.ubuntu.com'
W: Failed to fetch http://cfengine.com/pub/apt/packages/dists/stable/InRelease  Temporary failure resolving 'cfengine.com'
W: Failed to fetch https://artifacts.elastic.co/packages/5.x/apt/dists/stable/InRelease  Could not resolve host: artifacts.elastic.co
W: Failed to fetch https://download.docker.com/linux/ubuntu/dists/xenial/InRelease  Could not resolve host: download.docker.com
W: Failed to fetch http://ppa.launchpad.net/openjdk-r/ppa/ubuntu/dists/xenial/InRelease  Temporary failure resolving 'ppa.launchpad.net'
W: Failed to fetch http://nginx.org/packages/ubuntu/dists/xenial/InRelease  Temporary failure resolving 'nginx.org'
W: Failed to fetch http://apt.postgresql.org/pub/repos/apt/dists/xenial-pgdg/InRelease  Temporary failure resolving 'apt.postgresql.org'
W: Failed to fetch http://apt.postgresql.org/pub/repos/apt/dists/utopic-pgdg/InRelease  Temporary failure resolving 'apt.postgresql.org'
W: Failed to fetch http://ppa.launchpad.net/nginx/stable/ubuntu/dists/xenial/InRelease  Temporary failure resolving 'ppa.launchpad.net'
W: Some index files failed to download. They have been ignored, or old ones used instead.
root@e5cbef35b7d2:/run/resolvconf#

0 个答案:

没有答案