dnsmasq should automatically use the /etc/hosts file. This can be disabled by the -h command line option or no-hosts configuration option. I would not expect either to be set in the default configuration.

Try forcing dnsmasq to reload its hosts file. (Changes to the configuration file require a restart). Either of these commands should work.

service dnsmasq reload
kill -HUP $(pidof dnsmasq)

If you are working with a system that has no-hosts specified you should be able to use the addn-hosts option to override it. Normally, this would be used to read an additional file in /etc/hosts format. This can be used to specify additional host data that you want DNS to provide, but don't want in your /etc/hosts file. This can be used to allow the package manager and related tools to manage /etc/hosts while additional hosts data is provided in an alternate file.

I don't know what I did. it seems to be working now
–
bakytnApr 1 '12 at 14:51

2

Why would you answer this when you don't actually know the answer? The fact that you "would not expect either to be set in the default configuration" does not make it the case as it in fact is set and hard-coded into dnsmasq in NetworkManger.
–
Justin BuserOct 25 '12 at 22:29

dnsmasq must be restarted in order to load changes in configuration files
–
txwikingerAug 23 '14 at 15:24

@txwikinger Many options files are reread when dnsmasq receive a HUP signal. This includes both the /etc/hosts and /etc/ethers files. Restart times are fast enough, that it will be rare for clients to not get a response.
–
BillThor Aug 24 '14 at 17:29