2017-01-05 23 views
-1

我最近開始嘗試使用LXD容器,並遇到了一個我似乎無法解決的基本障礙。LXD容器內部的DNS解析不起作用

我不能夠運行和apt updated容器

[email protected]:~$ lxc exec adil-php5 -- apt update 
.... 
Err http://archive.ubuntu.com trusty Release.gpg 
    Could not resolve 'archive.ubuntu.com' 
Err http://archive.ubuntu.com trusty-updates Release.gpg 
    Could not resolve 'archive.ubuntu.com' 
Err http://archive.ubuntu.com trusty-backports Release.gpg 
    Could not resolve 'archive.ubuntu.com' 
Err http://security.ubuntu.com trusty-security Release.gpg 
    Could not resolve 'security.ubuntu.com' 
.... 

的一篇文章建議切換到nictype macvlan內。這也沒有幫助。我的貨幣「默認」的分佈是:

lxc profile show default 
name: default 
config: {} 
description: Default LXD profile 
devices: 
    eth0: 
    name: eth0 
    nictype: bridged 
    parent: lxdbr0 
    type: nic 

主持人:Ubuntu的16.04 集裝箱:Ubuntu的14.04

+0

我敢打賭,你的容器resolv.conf中不使用可訪問的DNS服務器從你的主機,或者是空的。 – Tensibai

回答