Hi all,
I have set up a KVM host with two guest vms. I want to connect from the host to the guests by name, but the name resolution does not seem to work.
I have followed section 12.1.1.5 Obtaining IP Addresses with nsswitch for NAT Networks (in KVM) in the Virtualization Guide:
- install package libvirt-nss (with YaST, not with zypper)
- Add libvirt to the hosts line in /etc/nsswitch.conf
- restart nscd (I also rebooted, just in case)
But that does not seem to work. If I do on the host:
# ping guest1
ping: guest1: Name or service not known
Both guests can ping each other by name. The host can ping both guests by IP.
nslookup seems to indicate that libvirt is not actually being used for name lookup:
# nslookup guest1
Server: xxx.xxx.xxx.21
Address: xxx.xxx.xxx.21#53
** server can't find guest1: NXDOMAIN
xxx.xxx.xxx.21 is the primary DNS configured in Network Settings for the host.
If I instruct nslookup to query the virtual DNS server explicitly, the name lookup succeeds:
# nslookup guest1 192.168.122.1
Server: 192.168.122.1
Address: 192.168.122.1#53
Name: guest1
Address: 192.168.122.201
This corresponds to the information in the file /var/lib/libvirt/dnsmasq/virbr0.status :
“ip-address”: “192.168.122.201”,
“hostname”: “guest1”
…
“ip-address”: “192.168.122.202”,
“hostname”: “guest2”
The virtual network is the default virbr0 NAT-ed network created automatically by YaST.
The host network is configured with wicked, static IP, primary and secondary DNS, and the network interface is a bond of eth0 and eth1.
I’ve played a little with the setting of NETCONFIG_DNS_STATIC_SERVERS in the sysconfig editor, but to no avail.
Any ideas are much appreciated,
Uos