[Dnsmasq-discuss] host resolved local and remote records too

Simon Kelley simon at thekelleys.org.uk
Fri Jan 18 15:22:42 GMT 2013


On 18/01/13 08:53, Papp Tamas wrote:
> On 01/17/2013 04:12 PM, Papp Tamas wrote:
>>
>> hi All,
>>
>> I don't find the appropriate configuration for a situation.
>>
>> $ host machine.domain.com
>> machine.domain.com has address 10.0.0.156
>> machine.domain.com is an alias for fw.domain.com.
>> machine.domain.com is an alias for fw.domain.com.
>>
>>
>> hosts file entry:
>>
>> 10.0.0.156 machine machine.domain.com
>>
>>
>> Ouside:
>>
>> $ host machine.domain.com 8.8.8.8
>> Using domain server:
>> Name: 8.8.8.8
>> Address: 8.8.8.8#53
>> Aliases:
>>
>> machine.domain.com is an alias for fw.chemaxon.com.
>> fw.domain.com has address 1.1.1.1
>>
>>
>> So dnsmasq is configured to resolve machine.domain.com to a local IP
>> address, it works fine.
>> However in the internet domain.com is a real domain and there is the
>> hostname as a CNAME record. And
>> among with the masked hostname dnsmasq resolves the CNAME record too.
>>
>>
>> Why is that? How can I avoid this behaviour?
>>
>
> If I set it as CNAME record in the dnsmasq configuration, works fine.
> But I want to keep the information in the hosts file.
>

There's now way to represent a CNAME in the hosts file - the format and 
semantics of that file are defined elsewhere, and we can't extend it.

If you just want to keep all the information in _one_ file, you can more 
the stuff in /etc/hosts to the dnsmasq configuration file: see 
--host-record.


Cheers,

Simon.



More information about the Dnsmasq-discuss mailing list