Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED]NetworkManager not work with dnsmasq
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Jusong
n00b
n00b


Joined: 06 Nov 2012
Posts: 11

PostPosted: Fri Oct 21, 2016 8:30 am    Post subject: [SOLVED]NetworkManager not work with dnsmasq Reply with quote

i set /etc/NetworkManager/NetworkManager.conf follow the instructions in the wiki https://wiki.gentoo.org/wiki/NetworkManager#Dnsmasq
Code:

[main]
plugins=keyfile
dns=dnsmasq


then restart NetworkManger,and cat /etc/reslov.conf got
Code:
nameserver 127.0.0.1

use dig to test dnsmasq is ok,but after a while the /etc/reslov.conf changed to
Code:
nameserver 10.0.0.1

and dig test that dns server is 10.0.0.1, dnsmasq not work, i don't know why the file of /etc/reslov.conf changed automatic, anybody can help me?


Last edited by Jusong on Tue Oct 25, 2016 6:48 am; edited 3 times in total
Back to top
View user's profile Send private message
Roman_Gruber
Advocate
Advocate


Joined: 03 Oct 2006
Posts: 3806
Location: Austro Bavaria

PostPosted: Fri Oct 21, 2016 8:35 am    Post subject: Reply with quote

So what is your question?
Back to top
View user's profile Send private message
xaviermiller
Administrator
Administrator


Joined: 23 Jul 2004
Posts: 8070
Location: ~Brussels - Belgique

PostPosted: Fri Oct 21, 2016 8:36 am    Post subject: Reply with quote

Moved to the Chinese subforum
_________________
Kind regards,
Xavier Miller
Back to top
View user's profile Send private message
xaviermiller
Administrator
Administrator


Joined: 23 Jul 2004
Posts: 8070
Location: ~Brussels - Belgique

PostPosted: Fri Oct 21, 2016 9:07 am    Post subject: Reply with quote

Re-moved to an english sub-forum :)
_________________
Kind regards,
Xavier Miller
Back to top
View user's profile Send private message
Jusong
n00b
n00b


Joined: 06 Nov 2012
Posts: 11

PostPosted: Fri Oct 21, 2016 9:10 am    Post subject: Reply with quote

xaviermiller wrote:
Re-moved to an english sub-forum :)

thanks :D
Back to top
View user's profile Send private message
Logicien
Veteran
Veteran


Joined: 16 Sep 2005
Posts: 1372
Location: Montréal

PostPosted: Fri Oct 21, 2016 7:16 pm    Post subject: Reply with quote

NetworkManager can write in /etc/resolv.conf but other applications can do it too like Dnsmasq itself, Dhcpcd, Dhclient and Resolvconf. If NetworkManager have some configured connexions it can write again in /etc/resolv.conf using a Dhcp client for example. The configuration of Dnsmasq can do so too. Most applications who touch /etc/resolv.conf can be configure to not write in.

I suppose that Dnsmasq have some public Dns servers in it's configuration to resolv domain names because, 127.0.0.1 resolv nothing unless it lead to Named and it's public Dns servers for the resolution.

You can have a more precise idea of what is running related to the domain names resolution with the command
Code:
ps aux | grep -i -e dh -e dns -e name -e net -e reso -e wpa

_________________
Paul
Back to top
View user's profile Send private message
Jusong
n00b
n00b


Joined: 06 Nov 2012
Posts: 11

PostPosted: Tue Oct 25, 2016 5:42 am    Post subject: Reply with quote

Logicien wrote:
NetworkManager can write in /etc/resolv.conf but other applications can do it too like Dnsmasq itself, Dhcpcd, Dhclient and Resolvconf. If NetworkManager have some configured connexions it can write again in /etc/resolv.conf using a Dhcp client for example. The configuration of Dnsmasq can do so too. Most applications who touch /etc/resolv.conf can be configure to not write in.

I suppose that Dnsmasq have some public Dns servers in it's configuration to resolv domain names because, 127.0.0.1 resolv nothing unless it lead to Named and it's public Dns servers for the resolution.

You can have a more precise idea of what is running related to the domain names resolution with the command
Code:
ps aux | grep -i -e dh -e dns -e name -e net -e reso -e wpa


the output:
Code:

root      2141  0.0  0.3 581780 13704 ?        Ssl  10:00   0:04 /usr/sbin/NetworkManager --no-daemon
root      2203  0.0  0.1  36716  5700 ?        Ss   10:00   0:01 /usr/sbin/wpa_supplicant -u
root      2244  0.0  0.2  16816  9736 ?        S    10:00   0:00 /sbin/dhclient -d -q -sf /usr/libexec/nm-dhcp-helper -pf /run/dhclient-wlp4s0.pid -lf /var/lib/NetworkManager/dhclient-b3dbbb03-03f4-4cd8-a3b5-fd0ca87186e2-wlp4s0.lease -cf /var/lib/NetworkManager/dhclient-wlp4s0.conf wlp4s0


there is dhclient work with my NM, i try to uncomment below line in /etc/dhcp/dhclient.conf
Code:
prepend domain-name-servers 127.0.0.1;

and then restart NM, exec cat /etc/resolv.conf got
Code:
# Generated by NetworkManager
nameserver 127.0.0.1
nameserver 10.0.0.1

and dig www.gentoo.org show that dns server is 127.0.0.1, so it looks like work well, thanks for your reminder :D
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum