[PC-BSD Commits] r15801 - pcbsd/current/src-qt4/pc-netmanager/src/NetworkManager

svn at pcbsd.org svn at pcbsd.org
Tue Mar 13 12:43:54 PDT 2012


Author: kris
Date: 2012-03-13 19:43:54 +0000 (Tue, 13 Mar 2012)
New Revision: 15801

Modified:
   pcbsd/current/src-qt4/pc-netmanager/src/NetworkManager/networkman.cpp
Log:

When we save a custom DNS line, make sure it survives a dhclient run



Modified: pcbsd/current/src-qt4/pc-netmanager/src/NetworkManager/networkman.cpp
===================================================================
--- pcbsd/current/src-qt4/pc-netmanager/src/NetworkManager/networkman.cpp	2012-03-13 16:54:14 UTC (rev 15800)
+++ pcbsd/current/src-qt4/pc-netmanager/src/NetworkManager/networkman.cpp	2012-03-13 19:43:54 UTC (rev 15801)
@@ -1083,6 +1083,14 @@
    } else {
      Utils::setConfFileValue("/etc/resolv.conf", "nameserver", "nameserver " + lineDNS2->text(), DNSline);  
    }   
+   
+   // If we have custom DNS, make sure it survives a dhclient run
+   if ( lineDNS1->text() != "..." && lineDNS2->text() != "..." )
+     Utils::setConfFileValue("/etc/dhclient.conf", "supersede domain-name-servers", "supersede domain-name-servers " + lineDNS1->text() + ", " + lineDNS2->text() +";");  
+   else if ( lineDNS1->text() != "..." )
+     Utils::setConfFileValue("/etc/dhclient.conf", "supersede domain-name-servers", "supersede domain-name-servers " + lineDNS1->text() +";");  
+   else if ( lineDNS2->text() != "..." )
+     Utils::setConfFileValue("/etc/dhclient.conf", "supersede domain-name-servers", "supersede domain-name-servers " + lineDNS2->text() +";");  
 
    if ( lineSearchDomain->text().isEmpty() ) {
      Utils::setConfFileValue("/etc/resolv.conf", "search", "", 1);



More information about the Commits mailing list