Bug 559211 - Please provide a way to specify a hosts file for dnsmasq
Summary: Please provide a way to specify a hosts file for dnsmasq
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libvirt
Version: unspecified
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Libvirt Maintainers
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 711276
TreeView+ depends on / blocked
 
Reported: 2010-01-27 13:17 UTC by Andreas Rottmann
Modified: 2015-01-07 13:47 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2015-01-07 13:47:06 UTC
Embargoed:


Attachments (Terms of Use)

Description Andreas Rottmann 2010-01-27 13:17:43 UTC
Currently, it seems not to be possible to specify a hosts file for the dnsmasq process launched by the network bridge driver. However, this poses a configuration problem, as then dnsmasq will use /etc/hosts, and this file commonly contains a line like this (delenn being the hostname of the host system):

127.0.1.1       delenn delenn.lan

This in turn will lead to guest VMs resolving `delenn' to the wrong (a loopback) IP address, when it instead should resolve to an IP address that can be reached by the guest VMs. Providing a way to specify the hosts file to be used by dnsmasq would allow resolving that issue.

Comment 1 Michal Privoznik 2015-01-07 13:47:06 UTC
I think this bug is fixed already. I mean, there's a way to specify DNS records in the network XML:

<network>
  <name>default</name>
  <uuid>81ff0d90-c91e-6742-64da-4a736edb9a9c</uuid>
  <forward dev='eth0' mode='nat'/>
  <bridge name='virbr0' stp='on' delay='0'/>
  <domain name="example.com"/>
  <dns forwardPlainNames='no'>
    <host ip='192.168.122.1'>
      <hostname>host</hostname>
      <hostname>gateway</hostname>
    </host>
  </dns>
  <ip address='192.168.122.1' netmask='255.255.255.0'>
  </ip>
</network>

The other option is to forward DNS requests:

<network>
  <name>default</name>
  <uuid>81ff0d90-c91e-6742-64da-4a736edb9a9c</uuid>
  <forward dev='eth0' mode='nat'/>
  <bridge name='virbr0' stp='on' delay='0'/>
  <dns>
    <forwarder addr='8.8.8.8'/>
    <forwarder addr='8.8.4.4'/>
  </dns>
  <ip address='192.168.122.1' netmask='255.255.255.0'>
  </ip>
</network>

If you disagree, please feel free to reopen.


Note You need to log in before you can comment on or make changes to this bug.