AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 409794
Accepted
Meltemi
Meltemi
Asked: 2012-07-21 15:04:31 +0800 CST2012-07-21 15:04:31 +0800 CST 2012-07-21 15:04:31 +0800 CST

Vagrant/VirtualBox 无法从 VM 中解析某些域

  • 772

只是尝试 VirtualBox & Vagrant 和我的初始lucid64VM 无法解析us.archive.ubuntu.com但可以解析security.ubuntu.com,google.com和www.apple.com(但不是没有apple.com?www!?!)。

运行 VM的主机可以很好地解析us.archive.ubuntu.com以及所有其他域。

不知道发生了什么事?!?

vagrant@lucid64:~$ sudo apt-get install dkms -y
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  fakeroot make patch
Suggested packages:
  make-doc diffutils-doc
The following NEW packages will be installed:
  dkms fakeroot make patch
0 upgraded, 4 newly installed, 0 to remove and 23 not upgraded.
Need to get 458kB of archives.
After this operation, 2,359kB of additional disk space will be used.
Err http://us.archive.ubuntu.com/ubuntu/ lucid/main make 3.81-7ubuntu1
  Could not resolve 'us.archive.ubuntu.com'
Err http://us.archive.ubuntu.com/ubuntu/ lucid/main patch 2.6-2ubuntu1
  Could not resolve 'us.archive.ubuntu.com'
Err http://us.archive.ubuntu.com/ubuntu/ lucid-updates/main dkms 2.1.1.2-2ubuntu1
  Could not resolve 'us.archive.ubuntu.com'
Err http://us.archive.ubuntu.com/ubuntu/ lucid/main fakeroot 1.14.4-1ubuntu1
  Could not resolve 'us.archive.ubuntu.com'
Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/m/make-dfsg/make_3.81-7ubuntu1_amd64.deb  Could not resolve 'us.archive.ubuntu.com'
Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/p/patch/patch_2.6-2ubuntu1_amd64.deb  Could not resolve 'us.archive.ubuntu.com'
Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/d/dkms/dkms_2.1.1.2-2ubuntu1_all.deb  Could not resolve 'us.archive.ubuntu.com'
Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/f/fakeroot/fakeroot_1.14.4-1ubuntu1_amd64.deb  Could not resolve 'us.archive.ubuntu.com'
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

香草安装。我的第一次尝试。按照部署 Rails 书中的说明进行操作。

编辑:添加/etc/resolv.conf:

vagrant@lucid64:~$ cat /etc/resolv.conf 
nameserver 10.0.2.3
domain mydomain.com
search mydomain.com

还有一些挖掘信息:

vagrant@lucid64:~$ dig us.archive.ubuntu.com
;; Truncated, retrying in TCP mode.

; <<>> DiG 9.7.0-P1 <<>> us.archive.ubuntu.com
;; global options: +cmd
;; connection timed out; no servers could be reached

+trace但它似乎在使用标志时解析域名?!?(或者我读错了吗?)

vagrant@lucid64:~$ dig us.archive.ubuntu.com +trace

; <<>> DiG 9.7.0-P1 <<>> us.archive.ubuntu.com +trace
;; global options: +cmd
.           199183  IN  NS  d.root-servers.net.
.           199183  IN  NS  k.root-servers.net.
.           199183  IN  NS  m.root-servers.net.
.           199183  IN  NS  a.root-servers.net.
.           199183  IN  NS  j.root-servers.net.
.           199183  IN  NS  e.root-servers.net.
.           199183  IN  NS  l.root-servers.net.
.           199183  IN  NS  b.root-servers.net.
.           199183  IN  NS  f.root-servers.net.
.           199183  IN  NS  g.root-servers.net.
.           199183  IN  NS  h.root-servers.net.
.           199183  IN  NS  i.root-servers.net.
.           199183  IN  NS  c.root-servers.net.
;; Received 256 bytes from 10.0.2.3#53(10.0.2.3) in 1 ms

com.            172800  IN  NS  a.gtld-servers.net.
com.            172800  IN  NS  b.gtld-servers.net.
com.            172800  IN  NS  c.gtld-servers.net.
com.            172800  IN  NS  d.gtld-servers.net.
com.            172800  IN  NS  e.gtld-servers.net.
com.            172800  IN  NS  f.gtld-servers.net.
com.            172800  IN  NS  g.gtld-servers.net.
com.            172800  IN  NS  h.gtld-servers.net.
com.            172800  IN  NS  i.gtld-servers.net.
com.            172800  IN  NS  j.gtld-servers.net.
com.            172800  IN  NS  k.gtld-servers.net.
com.            172800  IN  NS  l.gtld-servers.net.
com.            172800  IN  NS  m.gtld-servers.net.
;; Received 499 bytes from 193.0.14.129#53(k.root-servers.net) in 191 ms

ubuntu.com.     172800  IN  NS  ns1.canonical.com.
ubuntu.com.     172800  IN  NS  ns2.canonical.com.
ubuntu.com.     172800  IN  NS  ns3.canonical.com.
;; Received 151 bytes from 192.42.93.30#53(g.gtld-servers.net) in 46 ms

us.archive.ubuntu.com.  600 IN  A   91.189.92.192
us.archive.ubuntu.com.  600 IN  A   91.189.92.193
us.archive.ubuntu.com.  600 IN  A   91.189.91.13
us.archive.ubuntu.com.  600 IN  A   91.189.91.23
us.archive.ubuntu.com.  600 IN  A   91.189.91.24
us.archive.ubuntu.com.  600 IN  A   91.189.91.25
us.archive.ubuntu.com.  600 IN  A   91.189.92.151
us.archive.ubuntu.com.  600 IN  A   91.189.92.152
us.archive.ubuntu.com.  600 IN  A   91.189.92.153
us.archive.ubuntu.com.  600 IN  A   91.189.92.154
us.archive.ubuntu.com.  600 IN  A   91.189.92.155
us.archive.ubuntu.com.  600 IN  A   91.189.92.176
us.archive.ubuntu.com.  600 IN  A   91.189.92.177
us.archive.ubuntu.com.  600 IN  A   91.189.92.179
us.archive.ubuntu.com.  600 IN  A   91.189.92.180
us.archive.ubuntu.com.  600 IN  A   91.189.92.181
us.archive.ubuntu.com.  600 IN  A   91.189.92.182
us.archive.ubuntu.com.  600 IN  A   91.189.92.183
us.archive.ubuntu.com.  600 IN  A   91.189.92.184
ubuntu.com.     172800  IN  NS  ns2.canonical.com.
ubuntu.com.     172800  IN  NS  ns3.canonical.com.
ubuntu.com.     172800  IN  NS  ns1.canonical.com.
;; Received 455 bytes from 91.189.95.3#53(ns2.canonical.com) in 183 ms

Edit2 - 更多挖掘:

vagrant@lucid64:~$ dig @10.0.2.3 security.ubuntu.com +short
91.189.92.181
91.189.92.184
91.189.92.151
91.189.92.166
vagrant@lucid64:~$ dig @10.0.2.3 us.archive.ubuntu.com
;; Truncated, retrying in TCP mode.

; <<>> DiG 9.7.0-P1 <<>> @10.0.2.3 us.archive.ubuntu.com
; (1 server found)
;; global options: +cmd
;; connection timed out; no servers could be reached
ubuntu
  • 3 3 个回答
  • 15027 Views

3 个回答

  • Voted
  1. Danilo G. Botelho
    2014-08-14T08:04:13+08:002014-08-14T08:04:13+08:00

    我通过将以下行添加到我的 Vagrantfile 中解决了这个问题:

    config.vm.provider :virtualbox do |vb|
        vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
    end
    

    以下是它的全部内容:

    $setup = <<SCRIPT
        DEBIAN_FRONTEND=noninteractive apt-get update
    SCRIPT
    
    $dependencies = <<SCRIPT
        DEBIAN_FRONTEND=noninteractive apt-get install -y postgresql libpq-dev
        DEBIAN_FRONTEND=noninteractive apt-get install -y python-dev libjpeg-dev zlib1g-dev
        DEBIAN_FRONTEND=noninteractive apt-get install -y python-virtualenv virtualenvwrapper
    SCRIPT
    
    Vagrant.configure('2') do |config|
    
        config.vm.box = 'ubuntu/trusty64'
    
        # config.ssh.forward_agent = true
        config.vm.network "private_network", ip: "192.168.10.90"
    
        config.vm.synced_folder ".", "/vagrant", id: "vagrant-root", disabled: true
        config.vm.synced_folder ".", "/siaq"
    
        config.vm.provider :virtualbox do |vb|
            vb.name = "siaq"
            vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
            vb.customize ["modifyvm", :id, "--memory", "512"]
        end
    
        config.vm.provision "shell", inline: $setup
        config.vm.provision "shell", inline: $dependencies
    end
    
    • 13
  2. SilverbackNet
    2012-07-21T17:56:23+08:002012-07-21T17:56:23+08:00

    看起来是因为您根本无法联系 DNS 服务器集,并且它正在尝试使用根提示(根据我的经验,这对最终用户来说非常不可靠)。你能ping通吗?您是否设置为桥接模式,没有防火墙阻碍?

    • 0
  3. Best Answer
    Meltemi
    2012-08-12T13:44:34+08:002012-08-12T13:44:34+08:00

    当我将主机 Mac OS 从 Lion (10.7.4) 升级到 Mountain Lion (10.8) 时,这似乎“神奇地”自行解决了,所以不会再浪费周期了。

    • 0

相关问题

  • 无法通过 Ubuntu VPN 访问外部网络

  • ubuntu apt-get upgrade - 如何在 shell 中单击确定?

  • VirtualBox 上 Ubuntu 的访客优化技巧 [关闭]

  • 外部硬盘上的 virtualbox 虚拟硬盘驱动器(Vista 主机上的 ubuntu 客户机)

  • 如何在 Ubuntu 上挂载 LVM 分区?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve