Re: [Dnsmasq-discuss] [PATCH] Do not set resolv.conf to 127.0.0.1 if port=0

2017-04-11 Thread Simon Kelley
Patch applied.

Cheers,

Simon.



On 01/04/17 22:27, Floris Bos wrote:
> dnsmasq's startup script seems to assume users always want to use
> dnsmasq as local DNS resolver, and tells resolvconf to put
> "nameserver 127.0.0.1" in /etc/resolv.conf
> The problem with this is that if users just want to use dnsmasq
> as DHCP server, and put port=0 in /etc/dnsmasq.conf to disable
> the DNS functionality, they end up with broken name resolving.
> 
> Put a basic check in the startup script that skips resolvconf
> configuration if a line starting with port=0 is in /etc/dnsmasq.conf
> This doesn't cover all cases (e.g. configuration could also be in
>  different file in /etc/dnsmasq.d), but is better than current
> situation.




signature.asc
Description: OpenPGP digital signature
___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


[Dnsmasq-discuss] [PATCH] Do not set resolv.conf to 127.0.0.1 if port=0

2017-04-01 Thread Floris Bos
dnsmasq's startup script seems to assume users always want to use
dnsmasq as local DNS resolver, and tells resolvconf to put
"nameserver 127.0.0.1" in /etc/resolv.conf
The problem with this is that if users just want to use dnsmasq
as DHCP server, and put port=0 in /etc/dnsmasq.conf to disable
the DNS functionality, they end up with broken name resolving.

Put a basic check in the startup script that skips resolvconf
configuration if a line starting with port=0 is in /etc/dnsmasq.conf
This doesn't cover all cases (e.g. configuration could also be in
 different file in /etc/dnsmasq.d), but is better than current
situation.

Signed-off-by: Floris Bos 
---
 debian/init | 5 +
 1 file changed, 5 insertions(+)

diff --git a/debian/init b/debian/init
index 8c562de..46abdc4 100644
--- a/debian/init
+++ b/debian/init
@@ -154,6 +154,11 @@ start_resolvconf()
[ $interface = lo ] && return
done
 
+# Also skip this if DNS functionality is disabled in /etc/dnsmasq.conf
+   if grep -qs '^port=0' /etc/dnsmasq.conf; then
+   return
+   fi
+
 if [ -x /sbin/resolvconf ] ; then
echo "nameserver 127.0.0.1" | /sbin/resolvconf -a lo.$NAME
fi
-- 
2.7.4


___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss