[CentOS] Erratic local hostname resolution with Dnsmasq

Wed Jan 2 15:38:56 UTC 2019
Nicolas Kovacs <info at microlinux.fr>

Le 02/01/2019 à 16:09, Nicolas Kovacs a écrit :
> Of course I could add all these hosts to /etc/hosts, but as far as I 
> understand, this *should* work with the hosts appearing only in 
> /etc/dnsmasq.conf. Or have I overlooked something ? Any suggestions
> ?

>From what this *looks like* after experimenting, Dnsmasq isn't 100 %
able to read hostnames from dnsmasq.conf, and if I want complete local
resolution, I have to put each hostname - in long and short form - in
the servers' /etc/hosts file. In my case:

[root at nestor:~] # cat /etc/hosts
# /etc/hosts     localhost.localdomain localhost   nestor.microlinux.lan nestor   alphamule.microlinux.lan alphamule   bernadette.microlinux.lan bernadette   raymonde.microlinux.lan raymonde   amandine.microlinux.lan amandine   buzz.microlinux.lan buzz   balthazar.microlinux.lan balthazar  centosbox.microlinux.lan centosbox  susebox.microlinux.lan susebox hp-officejet.microlinux.lan hp-officejet nas.microlinux.lan nas wifi.microlinux.lan wifi

In my case, this works perfectly, and I can resolve local hostnames on
the server and on each client.

So as far as I understand, the price to pay is only a small redundancy
between /etc/dnsmasq.conf and /etc/hosts.



Microlinux - Solutions informatiques durables
7, place de l'église - 30730 Montpezat
Site : https://www.microlinux.fr
Blog : https://blog.microlinux.fr
Mail : info at microlinux.fr
Tél. : 04 66 63 10 32