dracut/0039-network-add-rd.peerdns-0-parameter.patch

73 lines
2.9 KiB
Diff
Raw Normal View History

From df0bdd5ae9094133afa48b84189822e26d7bfecf Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Mon, 13 Jul 2015 10:14:15 +0200
Subject: [PATCH] network: add rd.peerdns=0 parameter
Add rd.peerdns=0 parameter to disable DHCP nameserver setting
---
dracut.cmdline.7.asc | 3 +++
modules.d/40network/dhclient-script.sh | 29 ++++++++++++++++-------------
2 files changed, 19 insertions(+), 13 deletions(-)
diff --git a/dracut.cmdline.7.asc b/dracut.cmdline.7.asc
index 55e6f64..1a54377 100644
--- a/dracut.cmdline.7.asc
+++ b/dracut.cmdline.7.asc
@@ -546,6 +546,9 @@ interface name. Better name it "bootnet" or "bluesocket".
**nameserver=**__<IP>__ [**nameserver=**__<IP>__ ...]::
specify nameserver(s) to use
+**rd.peerdns=0**::
+ Disable DNS setting of DHCP parameters.
+
**biosdevname=0**::
boolean, turn off biosdevname network interface renaming
diff --git a/modules.d/40network/dhclient-script.sh b/modules.d/40network/dhclient-script.sh
index c75ac89..1d891cd 100755
--- a/modules.d/40network/dhclient-script.sh
+++ b/modules.d/40network/dhclient-script.sh
@@ -54,13 +54,14 @@ setup_interface() {
echo ip route replace default via $gw dev $netif >> /tmp/net.$netif.gw
fi
- [ -n "${search}${domain}" ] && echo "search $search $domain" > /tmp/net.$netif.resolv.conf
- if [ -n "$namesrv" ] ; then
- for s in $namesrv; do
- echo nameserver $s
- done
- fi >> /tmp/net.$netif.resolv.conf
-
+ if getargbool 1 rd.peerdns; then
+ [ -n "${search}${domain}" ] && echo "search $search $domain" > /tmp/net.$netif.resolv.conf
+ if [ -n "$namesrv" ] ; then
+ for s in $namesrv; do
+ echo nameserver $s
+ done
+ fi >> /tmp/net.$netif.resolv.conf
+ fi
# Note: hostname can be fqdn OR short hostname, so chop off any
# trailing domain name and explicity add any domain if set.
[ -n "$hostname" ] && echo "echo ${hostname%.$domain}${domain:+.$domain} > /proc/sys/kernel/hostname" > /tmp/net.$netif.hostname
@@ -83,12 +84,14 @@ setup_interface6() {
${lease_time:+valid_lft $lease_time} \
${preferred_lft:+preferred_lft ${preferred_lft}}
- [ -n "${search}${domain}" ] && echo "search $search $domain" > /tmp/net.$netif.resolv.conf
- if [ -n "$namesrv" ] ; then
- for s in $namesrv; do
- echo nameserver $s
- done
- fi >> /tmp/net.$netif.resolv.conf
+ if getargbool 1 rd.peerdns; then
+ [ -n "${search}${domain}" ] && echo "search $search $domain" > /tmp/net.$netif.resolv.conf
+ if [ -n "$namesrv" ] ; then
+ for s in $namesrv; do
+ echo nameserver $s
+ done
+ fi >> /tmp/net.$netif.resolv.conf
+ fi
# Note: hostname can be fqdn OR short hostname, so chop off any
# trailing domain name and explicity add any domain if set.