Start before nss-lookup.target, hint modification to listen on IP (#1984618)

This commit is contained in:
Petr Menšík 2021-07-22 21:12:14 +02:00
parent e12e428986
commit 97b69aa4f1
3 changed files with 21 additions and 9 deletions

View File

@ -1,4 +1,4 @@
From 3a593d133f91c5126105efd03246b3f61f103dd4 Mon Sep 17 00:00:00 2001 From 194e7521399048e37c5c2cff18b9c8d442b893ae Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= <pemensik@redhat.com> From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= <pemensik@redhat.com>
Date: Tue, 30 Jun 2020 18:06:29 +0200 Date: Tue, 30 Jun 2020 18:06:29 +0200
Subject: [PATCH] Modify upstream configuration to safe defaults Subject: [PATCH] Modify upstream configuration to safe defaults
@ -7,11 +7,11 @@ Most important change would be to listen only on localhost. Default
configuration should not listen to request from remote hosts. Match also configuration should not listen to request from remote hosts. Match also
user and paths to directories shipped in Fedora. user and paths to directories shipped in Fedora.
--- ---
dnsmasq.conf.example | 24 +++++++++++++++++++----- dnsmasq.conf.example | 29 ++++++++++++++++++++++++-----
1 file changed, 19 insertions(+), 5 deletions(-) 1 file changed, 24 insertions(+), 5 deletions(-)
diff --git a/dnsmasq.conf.example b/dnsmasq.conf.example diff --git a/dnsmasq.conf.example b/dnsmasq.conf.example
index bf19424..36fba33 100644 index bf19424..8b85f44 100644
--- a/dnsmasq.conf.example --- a/dnsmasq.conf.example
+++ b/dnsmasq.conf.example +++ b/dnsmasq.conf.example
@@ -22,7 +22,7 @@ @@ -22,7 +22,7 @@
@ -53,7 +53,7 @@ index bf19424..36fba33 100644
# On systems which support it, dnsmasq binds the wildcard address, # On systems which support it, dnsmasq binds the wildcard address,
# even when it is listening on only some interfaces. It then discards # even when it is listening on only some interfaces. It then discards
# requests that it shouldn't reply to. This has the advantage of # requests that it shouldn't reply to. This has the advantage of
@@ -121,7 +127,11 @@ @@ -121,7 +127,16 @@
# want dnsmasq to really bind only the interfaces it is listening on, # want dnsmasq to really bind only the interfaces it is listening on,
# uncomment this option. About the only time you may need this is when # uncomment this option. About the only time you may need this is when
# running another nameserver on the same machine. # running another nameserver on the same machine.
@ -63,10 +63,15 @@ index bf19424..36fba33 100644
+# interfaces, bind only to lo device. Comment out to bind on single +# interfaces, bind only to lo device. Comment out to bind on single
+# wildcard socket. +# wildcard socket.
+bind-interfaces +bind-interfaces
+
+# Comment out above line and uncoment following 2 lines.
+# Update interface name, use ip link to get its name.
+#bind-dynamic
+#interface=eno1
# If you don't want dnsmasq to read /etc/hosts, uncomment the # If you don't want dnsmasq to read /etc/hosts, uncomment the
# following line. # following line.
@@ -535,7 +545,7 @@ @@ -535,7 +550,7 @@
# The DHCP server needs somewhere on disk to keep its lease database. # The DHCP server needs somewhere on disk to keep its lease database.
# This defaults to a sane location, but if you want to change it, use # This defaults to a sane location, but if you want to change it, use
# the line below. # the line below.
@ -75,7 +80,7 @@ index bf19424..36fba33 100644
# Set the DHCP server to authoritative mode. In this mode it will barge in # Set the DHCP server to authoritative mode. In this mode it will barge in
# and take over the lease for any client which broadcasts on the network, # and take over the lease for any client which broadcasts on the network,
@@ -673,7 +683,11 @@ @@ -673,7 +688,11 @@
# Include all files in a directory which end in .conf # Include all files in a directory which end in .conf
#conf-dir=/etc/dnsmasq.d/,*.conf #conf-dir=/etc/dnsmasq.d/,*.conf
@ -88,5 +93,5 @@ index bf19424..36fba33 100644
#dhcp-ignore-names=tag:wpad-ignore #dhcp-ignore-names=tag:wpad-ignore
+ +
-- --
2.26.2 2.31.1

View File

@ -1,6 +1,10 @@
[Unit] [Unit]
Description=DNS caching server. Description=DNS caching server.
Before=nss-lookup.target
Wants=nss-lookup.target
After=network.target After=network.target
; Use bind-dynamic or uncomment following to listen on non-local IP address
;After=network-online.target
[Service] [Service]
ExecStart=/usr/sbin/dnsmasq ExecStart=/usr/sbin/dnsmasq

View File

@ -20,7 +20,7 @@
Name: dnsmasq Name: dnsmasq
Version: 2.85 Version: 2.85
Release: 4%{?extraversion:.%{extraversion}}%{?dist} Release: 5%{?extraversion:.%{extraversion}}%{?dist}
Summary: A lightweight DHCP/caching DNS server Summary: A lightweight DHCP/caching DNS server
License: GPLv2 or GPLv3 License: GPLv2 or GPLv3
@ -184,6 +184,9 @@ install -Dpm 644 %{SOURCE2} %{buildroot}%{_sysusersdir}/%{name}.conf
%{_mandir}/man1/dhcp_* %{_mandir}/man1/dhcp_*
%changelog %changelog
* Thu Jul 22 2021 Petr Menšík <pemensik@redhat.com> - 2.85-5
- Start before nss-lookup.target, hint modification to listen on IP (#1984618)
* Thu Jul 22 2021 Petr Menšík <pemensik@redhat.com> - 2.85-4 * Thu Jul 22 2021 Petr Menšík <pemensik@redhat.com> - 2.85-4
- Update lease if hostname is assigned to a new lease (#1978718) - Update lease if hostname is assigned to a new lease (#1978718)