Difference between revisions of "Talk:Dnsmasq"

From ArchWiki
Jump to: navigation, search
(Created page with '== Testing without "http://" == In the test section it is recommended that the reader tries dig http://archlinux.org | grep "Query time" However, on both my systems running dnsm…')
 
(Easier way to work with NetworkManager: Close finished.)
(7 intermediate revisions by 4 users not shown)
Line 1: Line 1:
== Testing without "http://" ==
+
== need information for fixed IPs ==
In the test section it is recommended that the reader tries
+
when this is set in rc.conf I think that require :
  dig http://archlinux.org | grep "Query time"
+
  { echo "nameserver 127.0.0.1"; grep -v "^#" /etc/resolv.conf | head -2; } > /tmp/resolv.conf
However, on both my systems running dnsmasq-2.50, querying anything prefixed with a "http://" causes dnsmasq to automatically forward the query and not to cache the reply:
+
then backup /etc/resolv.conf and last :
  % dig "http://archlinux.org" | grep "Query time"; !#
+
  mv /tmp/resolv.conf /etc/resolv.conf
;; Query time: 493 msec
+
--[[User:Sputnick|Sputnick]] 17:59, 1 August 2011 (EDT)
;; Query time: 485 msec
+
 
The daemon logs
+
== <s> Easier way to work with NetworkManager </s> ==
dnsmasq: forwarded query to 208.67.220.220
+
 
dnsmasq: forwarded query to 208.67.220.220
+
If you add a line like
This might lead the reader to think dnsmasq is not working, when it actually works fine with:
+
 
% dig "archlinux.org" | grep "Query time"; !#
+
      dns=dnsmasq
;; Query time: 508 msec
+
 
;; Query time: 0 msec
+
to /etc/NetworkManager/NetworkManager.conf then not only will NetworkManager do the right thing about resolv.conf, it will also start up dnsmasq for us, which seems way easier. I just did it in my machine and it works OK. It uses a temp conf file for dnsmasq at /var/run/nm-dns-dnsmasq.conf, and resolv.conf has only 127.0.0.1. This is not OK if dnsmasq is used for DHCP server, but is very good for caching. As it seems to me this will be the most common pattern for people using NetworkManager, i added this at the start of the NetworkManager section, instead of at the end.
The daemon logs
+
 
dnsmasq: query[A] archlinux.org from 127.0.0.1
+
Also, i feel that calling "DHCP config" the section about adding 127.0.0.1 to resolv.conf is very easy to confuse with configuring the DHCP functionality of dnsmasq itself. So i just changed the name to "resolv.conf".
dnsmasq: forwarded archlinux.org to 208.67.222.222
+
 
dnsmasq: forwarded archlinux.org to 208.67.220.220
+
[[User:Mrpsbrk|Mrpsbrk]] ([[User talk:Mrpsbrk|talk]]) 03:35, 30 August 2012 (UTC)
dnsmasq: reply archlinux.org is 66.211.214.131
+
 
dnsmasq: query[A] archlinux.org from 127.0.0.1
+
: Nice edits, Mrpsbrk.  I hadn't known about this so this is *nice*.  Cleanedup the page a bit so all is OK. Danke --[[User:Gen2ly|Gen2ly]] ([[User talk:Gen2ly|talk]]) 23:17, 30 August 2012 (UTC)
dnsmasq: cached archlinux.org is 66.211.214.131
+
So, I'm removing the "http://" prefix. -- [[User:Tresende|Tresende]] 11:39, 12 November 2009 (EST)
+

Revision as of 09:56, 25 September 2012

need information for fixed IPs

when this is set in rc.conf I think that require :

{ echo "nameserver 127.0.0.1"; grep -v "^#" /etc/resolv.conf | head -2; } > /tmp/resolv.conf

then backup /etc/resolv.conf and last :

mv /tmp/resolv.conf /etc/resolv.conf

--Sputnick 17:59, 1 August 2011 (EDT)

Easier way to work with NetworkManager

If you add a line like

     dns=dnsmasq

to /etc/NetworkManager/NetworkManager.conf then not only will NetworkManager do the right thing about resolv.conf, it will also start up dnsmasq for us, which seems way easier. I just did it in my machine and it works OK. It uses a temp conf file for dnsmasq at /var/run/nm-dns-dnsmasq.conf, and resolv.conf has only 127.0.0.1. This is not OK if dnsmasq is used for DHCP server, but is very good for caching. As it seems to me this will be the most common pattern for people using NetworkManager, i added this at the start of the NetworkManager section, instead of at the end.

Also, i feel that calling "DHCP config" the section about adding 127.0.0.1 to resolv.conf is very easy to confuse with configuring the DHCP functionality of dnsmasq itself. So i just changed the name to "resolv.conf".

Mrpsbrk (talk) 03:35, 30 August 2012 (UTC)

Nice edits, Mrpsbrk. I hadn't known about this so this is *nice*. Cleanedup the page a bit so all is OK. Danke --Gen2ly (talk) 23:17, 30 August 2012 (UTC)