From f1598d7814b3c82b16f1a6b4e82ae41613e09501 Mon Sep 17 00:00:00 2001 From: Samuel Andaya Date: Sun, 14 Oct 2012 10:12:34 +0200 Subject: Add support for "options" in /etc/resolv.conf. Example DNS=('8.8.8.8' '8.8.4.4') DNS_OPTIONS=('rotate' 'timeout:1') Will create the following /etc/resolv.conf nameserver 8.8.8.8 nameserver 8.8.4.4 options rotate options timeout:1 (patch edited by Jouke Witteveen) --- docs/netcfg-profiles.5.txt | 2 ++ src/connections/ethernet | 3 +++ src/connections/openvpn | 3 +++ 3 files changed, 8 insertions(+) diff --git a/docs/netcfg-profiles.5.txt b/docs/netcfg-profiles.5.txt index 0d8b3f3..f929e47 100644 --- a/docs/netcfg-profiles.5.txt +++ b/docs/netcfg-profiles.5.txt @@ -107,6 +107,8 @@ DNS configuration +DNS+:: Array of DNS nameservers. Simply specify the IP's of each of the DNS nameservers. ++DNS_OPTIONS+:: + Array of ``option'' lines for '/etc/resolv.conf' +SEARCH+:: ``search'' line for '/etc/resolv.conf' +DOMAIN+:: diff --git a/src/connections/ethernet b/src/connections/ethernet index 33aae2f..a6a53bd 100644 --- a/src/connections/ethernet +++ b/src/connections/ethernet @@ -218,6 +218,9 @@ ethernet_up() { for dns in "${DNS[@]}"; do echo "nameserver $dns" >>/etc/resolv.conf done + for dnsoption in "${DNS_OPTIONS[@]}"; do + echo "option $dnsoption" >>/etc/resolv.conf + done fi return 0 diff --git a/src/connections/openvpn b/src/connections/openvpn index 27c8c65..6ecfeb7 100644 --- a/src/connections/openvpn +++ b/src/connections/openvpn @@ -28,6 +28,9 @@ openvpn_up() { for dns in "${DNS[@]}"; do echo "nameserver $dns" >>/etc/resolv.conf done + for dnsoption in "${DNS_OPTIONS[@]}"; do + echo "option $dnsoption" >>/etc/resolv.conf + done fi } -- cgit v1.2.3-24-g4f1b