LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 05-04-2015, 09:10 AM   #1
moesasji
Member
 
Registered: May 2008
Distribution: Slackware Current / OpenBSD
Posts: 322

Rep: Reputation: 104Reputation: 104
Getting Networkmanager to use Dnsmasq


I'm trying to setup Networkmanager to use dnsmasq to do DNS cache on a single Slackware machine that gets its IP address from the router. The reason that I want to use Networkmanager for this is that I want to have this working on my laptop that needs to connect to different wireless networks. Although I get the network-connection and the logfile mentions dnsmasq working it doesn't seem to cache, which I attribute to /etc/resolv.conf not having the localhost address.

I've set the configuration of Networkmanager as
Code:
[main]
plugins=keyfile
dhcp=dhcpcd
dns=dnsmasq

[keyfile]
hostname=dwarfstar
With this configuration /etc/resolv.conf remains
Code:
# Generated by NetworkManager
search lan
nameserver 192.168.1.254
So there is no localhost in that file, which I would expect for dnsmasq to work. I've tried to fix this by adding a file /etc/resolv.conf.head containing "nameserver 127.0.0.1" as recommended on the corresponding archlinux wiki. However this file is ignored and the resolv.conf file remains as above.

Can somebody provide me with a suggestion on how to make NetworkManager work with dnsmasq as I'm stuck on this and I can't find much guidance on Google.
 
Old 05-04-2015, 11:29 AM   #2
moesasji
Member
 
Registered: May 2008
Distribution: Slackware Current / OpenBSD
Posts: 322

Original Poster
Rep: Reputation: 104Reputation: 104
Quote:
Originally Posted by moesasji View Post
Can somebody provide me with a suggestion on how to make NetworkManager work with dnsmasq as I'm stuck on this and I can't find much guidance on Google.
Sometimes I really forget to check the "obvious" things.

With the above Networkmanager.conf networkmanager becomes responsible for starting dnsmasq. It can only start dnsmasq if it isn't running, so /etc/rc.d/rc.dnsmasq should be set as not executable. That way dns caching works as expected. Solved!

edit) For those that find this post through searching as this was equally difficult to find. Configuring dnsmasq started by Networkmanager is done by adding files in a dnsmasq.d directory containing the required options. These do get picked up, although I'm not sure whether they override the hardcoded options that are used when calling dnsmasq, see: http://cgit.freedesktop.org/NetworkM...-dns-dnsmasq.c (lines 270-300)

Last edited by moesasji; 05-05-2015 at 03:28 PM. Reason: added howto configure dnsmasq when started by Networkmanager as that was hard to find as well.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
dnsmasq as dhcp server on eth0 and networkmanager R03L Linux - Networking 31 04-13-2013 08:57 AM
dnsmasq harinathreddy.c Linux - Software 2 11-03-2012 12:46 AM
Dnsmasq imas Linux - Newbie 2 04-13-2012 06:12 AM
DNSMASQ anyone? Help! JeffC1 Linux - Software 3 03-31-2009 10:23 AM
Dnsmasq dunkyb Linux - Software 0 03-16-2003 02:25 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 05:17 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration