You are not logged in.
Pages: 1
When I create a VM guest using vagrant, the dns is not working on that guest. I am not sure how to investigate the issue. Please help me.
On arch host, cmd drill is not working but at the same time, pacman and web browser are both working ok to access internet.
Also on arch host, the service systemd-networkd and systemd-resolved are running.
The file /etc/resolv.conf is empty.
The file /etc/nsswitch.conf is as following:
$ drill wiki.archlinux.org
Error: error sending query: No (valid) nameservers defined in the resolver
$ getent hosts wiki.archlinux.org
2a01:4f8:172:1d86::1 apollo.archlinux.org
$ cat /etc/nsswitch.conf
# Name Service Switch configuration file.
# See nsswitch.conf(5) for details.
passwd: files mymachines systemd
group: files mymachines systemd
shadow: files
publickey: files
# hosts: files mymachines myhostname resolve [!UNAVAIL=return] dns
hosts: files libvirt libvirt_guest mymachines myhostname resolve [!UNAVAIL=return] dns
networks: files
protocols: files
services: files
ethers: files
rpc: files
netgroup: filesThe vagrant file:
$ cat Vagrantfile
Vagrant.configure("2") do |config|
config.vm.box_check_update = false
config.vm.box = "centos/7"
end$ virsh dumpxml centos-foo_default
<domain type='kvm' id='2'>
<name>centos-foo_default</name>
<uuid>f6722f1d-902b-4cbb-a94d-403ca95cf557</uuid>
......
<interface type='network'>
<mac address='52:54:00:8f:98:c4'/>
<source network='vagrant-libvirt' portid='b4d351c8-c642-4b73-9221-d639ec5a4a7d' bridge='virbr2'/>
<target dev='vnet0'/>
<model type='virtio'/>
<alias name='net0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
</interface>
......
</domain>$ virsh net-dumpxml vagrant-libvirt
<network connections='1' ipv6='yes'>
<name>vagrant-libvirt</name>
<uuid>25e0aa29-6f96-471c-bf27-9bf270a47705</uuid>
<forward mode='nat'>
<nat>
<port start='1024' end='65535'/>
</nat>
</forward>
<bridge name='virbr2' stp='on' delay='0'/>
<mac address='52:54:00:9c:f6:f9'/>
<ip address='192.168.121.1' netmask='255.255.255.0'>
<dhcp>
<range start='192.168.121.1' end='192.168.121.254'/>
</dhcp>
</ip>
</network>On guest,
$ vagrant ssh
Last login: Sun Jan 19 05:46:12 2020 from 192.168.121.1
[vagrant@localhost ~]$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 52:54:00:8f:98:c4 brd ff:ff:ff:ff:ff:ff
inet 192.168.121.134/24 brd 192.168.121.255 scope global noprefixroute dynamic eth0
valid_lft 2768sec preferred_lft 2768sec
inet6 fe80::5054:ff:fe8f:98c4/64 scope link
valid_lft forever preferred_lft forever
$ curl wiki.archlinux.org
curl: (6) Could not resolve host: wiki.archlinux.org; Unknown errorLast edited by wushuzh (2020-01-20 08:59:47)
Offline
The problem is on the host. I need to create a link to the stub resolve file as described in arch wiki for systemd-resolved. After that, the dns is working ok.
Offline
Pages: 1