[Dnsmasq-discuss] dnsmasq replies with 127.0.01

richardvoigt at gmail.com richardvoigt at gmail.com
Mon Aug 24 23:26:38 BST 2009


On Mon, Aug 24, 2009 at 4:40 PM, Enrique<cquike at arcor.de> wrote:
>
>  Hi,
>  yes, that right, the hostname is assigned to 127.0.0.1 via the /etc/hosts.
> Since the server gets its IP using DHCP, I could not hardcode the IP
> in /etc/hosts. However, the master DNS resolves my hostname properly, so that
> solved the problem.
>  At home, however, where I have another setup, my ISP doesn't resolve my
> hostname, of course. That forces me to put my hostname in /etc/hosts bound to
> 127.0.0.1, so the problem persists... Anyway, in my home setup it is not so
> important.


For dynamic addresses, this is the option you want:

--interface-name=<name>,<interface>
    Return a DNS record associating the name with the primary address
on the given interface. This flag specifies an A record for the given
name in the same way as an /etc/hosts line, except that the address is
not constant, but taken from the given interface. If the interface is
down, not configured or non-existent, an empty record is returned. The
matching PTR record is also created, mapping the interface address to
the name. More than one name may be associated with an interface
address by repeating the flag; in that case the first instance is used
for the reverse address-to-name mapping.

http://www.thekelleys.org.uk/dnsmasq/docs/dnsmasq-man.html

>
>
> El Domingo, 23 de Agosto de 2009, Carlos Carvalho escribió:
>> Enrique (cquike at arcor.de) wrote on 22 August 2009 23:51:
>>  > I am using dnsmasq in the context of the virt-manager software. My
>>  > server contains the virtualization software, including dnsmasq. I have
>>  > an issue when client of dnsmasq (one of the virtual machines) tries to
>>  > resolve the name of the server. Because dnsmasq runs in the server and
>>  > it reads the /etc/hosts file, it returns 127.0.0.1 as the IP of the
>>  > server, instead of the IP associated to eth0.
>>
>> How does dnsmasq discover that name-of-the-server is 127.0.0.1? In the
>> machines I run dnsmasq it's not able to guess that much. The only way
>> I can imagine is that you put this entry in /etc/hosts. If so, don't.
>> The only entry pointing to 127.0.0.1 should be localhost. Just put
>> IP-of-the-server name-of-the-server; no need to worry about routing,
>> the kernel is smart enough to discover it's local and send it to the
>> internal IP.
>>
>> _______________________________________________
>> Dnsmasq-discuss mailing list
>> Dnsmasq-discuss at lists.thekelleys.org.uk
>> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
>
>
>
> _______________________________________________
> Dnsmasq-discuss mailing list
> Dnsmasq-discuss at lists.thekelleys.org.uk
> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
>



More information about the Dnsmasq-discuss mailing list