summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeb Campbell <jeb-c4@pfsense.org>2005-08-30 19:12:56 +0000
committerJeb Campbell <jeb-c4@pfsense.org>2005-08-30 19:12:56 +0000
commitaad37fd2147b6994f7ded269290776982ca75290 (patch)
treeb9011895aeeb8b8eb11300c6e79adf551fb5ff8d
parent03af9b1a76337fb19370920705ca9629ad8c1405 (diff)
downloadpfsense-aad37fd2147b6994f7ded269290776982ca75290.zip
pfsense-aad37fd2147b6994f7ded269290776982ca75290.tar.gz
Dns from dhcp fixes for GG to test.
-rw-r--r--etc/inc/system.inc10
-rwxr-xr-xsbin/dhclient-script41
2 files changed, 13 insertions, 38 deletions
diff --git a/etc/inc/system.inc b/etc/inc/system.inc
index 1283ba1..58e3794 100644
--- a/etc/inc/system.inc
+++ b/etc/inc/system.inc
@@ -60,6 +60,16 @@ function system_resolvconf_generate($dynupdate = false) {
}
fclose($nfd);
}
+ $nfd = @fopen("{$g['varetc_path']}/defaultdomain.conf", "r");
+ if ($nfd and $havedns) {
+ while (!feof($nfd)) {
+ $dnss = trim(fgets($nfd));
+ if ($dnss) {
+ $resolvconf .= "search $dnss\n";
+ }
+ }
+ fclose($nfd);
+ }
}
if (!$havedns && is_array($syscfg['dnsserver'])) {
foreach ($syscfg['dnsserver'] as $ns) {
diff --git a/sbin/dhclient-script b/sbin/dhclient-script
index 7fb0f4c..ff1e029 100755
--- a/sbin/dhclient-script
+++ b/sbin/dhclient-script
@@ -136,52 +136,17 @@ add_new_routes() {
}
add_new_resolv_conf() {
- # XXX Old code did not create/update resolv.conf unless both
- # $new_domain_name and $new_domain_name_servers were provided. PR
- # #3135 reported some ISP's only provide $new_domain_name_servers and
- # thus broke the script. This code creates the resolv.conf if either
- # are provided.
-
- rm -f /var/etc/resolv.conf.std
-
- if [ -n "$new_domain_name" ]; then
- echo "search $new_domain_name" >>/var/etc/resolv.conf.std
- fi
rm -f /var/etc/nameservers.conf
if [ -n "$new_domain_name_servers" ]; then
for nameserver in $new_domain_name_servers; do
- echo "$nameserver" >>/var/etc/resolv.conf.std
echo $nameserver >>/var/etc/nameservers.conf
- echo $new_domain_name >/var/etc/defaultdomain.conf
done
+ echo $new_domain_name >/var/etc/defaultdomain.conf
fi
-
- if [ -f /var/etc/resolv.conf.std ]; then
- if [ -f /var/etc/resolv.conf.tail ]; then
- cat /var/etc/resolv.conf.tail >>/var/etc/resolv.conf.std
- fi
-
- # In case (e.g. during OpenBSD installs) /var/etc/resolv.conf
- # is a symbolic link, take care to preserve the link and write
- # the new data in the correct location.
-
- if [ -f /var/etc/resolv.conf ]; then
- cat /var/etc/resolv.conf > /var/etc/resolv.conf.save
- fi
- cat /var/etc/resolv.conf.std > /var/etc/nameservers.conf
- #cat /var/etc/resolv.conf.std > /var/etc/resolv.conf
- rm -f /var/etc/resolv.conf.std
-
- # Try to ensure correct ownership and permissions.
- chown -RL root:wheel /var/etc/resolv.conf
- chmod -RL 644 /var/etc/resolv.conf
-
- return 0
- fi
-
- return 1
+
+ return 0
}
# Must be used on exit. Invokes the local dhcp client exit hooks, if any.
OpenPOWER on IntegriCloud