# dnsmasq cname strange behavious

## javeree

I have a setup with one PC connected to internet acting as dns proxy and dhcp using dnsmasq (this PC is called 'Venus'), and multiple dhcp clients (one of which is called 'Juno')

When on Venus, I want the name 'Venus' to resolve to the localhost (because sometimes the ethernet card is not up, and then I would still like to access servers on Venus by name).

Another client must of course get the IP address of the ethernet card (which will always be up when there is a client)

Within the network, I pretend to have a domain name 'mydomain.net', which is actually a dynamic dns name. I want to move from the name 'mydomain.net' to a new name 'mynewdomain.net', without impacting all configurations on the clients (e.g. all mail clients), I want a translation from mynewdomain.net to mydoamin.net

I have the following data in /etc/conf.d/dnsmasq.conf

 *Quote:*   

> 
> 
> MYDOMAIN="mydomain.net"
> 
> DNSMASQ_OPTS=""
> ...

 

 *Quote:*   

> 
> 
> # /etc/hosts
> 
> 192.168.0.1     Venus.mydomain.net
> ...

 

Problem:

pinging Venus from Juno, I get the following:

ping Venus.mydomain.com

PING Venus.mydomain.com (192.168.0.1) 56(84) bytes of data.

ping Venus

PING Venus.mydomain.com (127.0.0.1) 56(84) bytes of data.

I would expect that dnsmasq changes the query for 'Venus' into a query for 'Venus.mydomain.net' due to --domain-needed, and then returns the result from /etc/hosts, so

==> this should return 192.168.0.1 !!!

What would be a way to get the desired behaviour (the name of the dnsmasq server to resolve to localhost when on the dnsmasq server, and to the ethernet interface address when called from a client).

----------

## truc

does dnsmasq really receive an unqualified domain name request?

check your resolv.conf, do you have any 'search' or 'domain' lines?

----------

