New user's registration have been closed due to high spamming and low trafic on this forum. Please contact forum admins directly if you need an account. Thanks !
[Fixed] Permanently change DNS
-
- Posts: 12
- Joined: 03 Aug 2009, 13:26
[Fixed] Permanently change DNS
I want to use OpenDNS instead of my ISP's DNS servers.
I'm using my Bubba2 as a router with dynamic IP on WAN and static IP on LAN. I've tried changing the DNS field in the Network -> LAN tab on the admin pages. But suddenly a couple of days ago it changed back to one of my ISP's servers.
How do I make this change permanent?
I'm using my Bubba2 as a router with dynamic IP on WAN and static IP on LAN. I've tried changing the DNS field in the Network -> LAN tab on the admin pages. But suddenly a couple of days ago it changed back to one of my ISP's servers.
How do I make this change permanent?
Last edited by christian.einarsson on 21 Dec 2009, 04:44, edited 1 time in total.
Re: Permanently change DNS
Hi Christian,
The web-ui does not support this atm. It modifies the /etc/resolv.conf file which is most likely overwritten later when you get an dhcp update on you wan interface.
An untested way to achieve this would be to manually edit the /etc/dhcp3/dhclient.conf file. Try adding something like a: resulting in the top lines look something like: optionally remove the domain-name-servers from the options in the request line.
/Tor
The web-ui does not support this atm. It modifies the /etc/resolv.conf file which is most likely overwritten later when you get an dhcp update on you wan interface.
An untested way to achieve this would be to manually edit the /etc/dhcp3/dhclient.conf file. Try adding something like a:
Code: Select all
supersede domain-name-servers ip.to.your.dnsprovider;
Code: Select all
request subnet-mask, broadcast-address, time-offset, routers,
domain-name, domain-name-servers, host-name,
netbios-name-servers, netbios-scope;
timeout 10;
supersede domain-name-servers ip.to.your.dnsprovider;
.
.
.
/Tor
Co-founder OpenProducts and Ex Excito Developer
-
- Posts: 12
- Joined: 03 Aug 2009, 13:26
Re: Permanently change DNS
Thank you, I will try this when I am back at home next week.
-
- Posts: 12
- Joined: 03 Aug 2009, 13:26
Re: Permanently change DNS
Finally did I get got some spare time to try this.
After some tinkering it looks like its working. My problem was that /etc/resolve.conf didn't seam to be updated even though the logs showed that my bubba renewed it's DHCP lease.
The thing I think did the trick was to run to manually trigger a full DHCP renew.
For future references, my OpenDNS enabled /etc/dhcp3/dhclient.conf looks like this.
After some tinkering it looks like its working. My problem was that /etc/resolve.conf didn't seam to be updated even though the logs showed that my bubba renewed it's DHCP lease.
The thing I think did the trick was to run
Code: Select all
sudo /sbin/dhclient eth0
For future references, my OpenDNS enabled /etc/dhcp3/dhclient.conf looks like this.
Code: Select all
request subnet-mask, broadcast-address, time-offset, routers,
domain-name, domain-name-servers, host-name,
netbios-name-servers, netbios-scope;
#OpenDNS should be used instead of DNS from ISP
supersede domain-name-servers 208.67.222.222, 208.67.220.220;
timeout 10;
lease {
interface "eth1";
fixed-address 1.2.3.1
option subnet-mask 255.255.255.0;
option broadcast-address 1.2.3.255;
option routers 1.2.3.1;
renew 6 2029/1/10 13:58:18;
rebind 3 2029/7/18 06:11:04;
expire 2 2038/1/19 03:14:07;
}
send host-name "bubba";
-
- Posts: 12
- Joined: 03 Aug 2009, 13:26
Re: Permanently change DNS
Well it seams that there are more than one way of updating /etc/resolv.conf. When I manually run /etc/resolv.conf gets updated with the DNS servers I've specified in /etc/dhcp3/dhclient.conf. But after a while they are replaced with the ones recieved from my DHCP, probably when Bubba2 does a automatic DHCP update.
Any ideas how to solve this?
Code: Select all
sudo /sbin/dhclient eth0
Any ideas how to solve this?
Re: Permanently change DNS
Christian,christian.einarsson wrote:Finally did I get got some spare time to try this.
For future references, my OpenDNS enabled /etc/dhcp3/dhclient.conf looks like this.Code: Select all
request subnet-mask, broadcast-address, time-offset, routers, domain-name, domain-name-servers, host-name, netbios-name-servers, netbios-scope; #OpenDNS should be used instead of DNS from ISP supersede domain-name-servers 208.67.222.222, 208.67.220.220; timeout 10; lease { interface "eth1"; fixed-address 1.2.3.1 option subnet-mask 255.255.255.0; option broadcast-address 1.2.3.255; option routers 1.2.3.1; renew 6 2029/1/10 13:58:18; rebind 3 2029/7/18 06:11:04; expire 2 2038/1/19 03:14:07; } send host-name "bubba";
What happens if you leave out the domain-name-servers from the request line in dhclient.conf
Code: Select all
request subnet-mask, broadcast-address, time-offset, routers,
domain-name, host-name, netbios-name-servers, netbios-scope;
#OpenDNS should be used instead of DNS from ISP
supersede domain-name-servers 208.67.222.222, 208.67.220.220;
effevee
-
- Posts: 12
- Joined: 03 Aug 2009, 13:26
Re: Permanently change DNS
Must have been very tired not to think of that. Tried it just now, this time with out doing a manual update. After about 10 minutes (probably my ISPs lease time) /etc/resolv.conf contained my desired DNS servers instead of my ISPs.
Changes to /etc/dhcp3/dhclient.conf so far...
I hope this did it, I will report in a few days when I know if the change is permanent.
Changes to /etc/dhcp3/dhclient.conf so far...
Code: Select all
# Removed 'domain-name-servers' to avoid asking DHCP for DNS server
request subnet-mask, broadcast-address, time-offset, routers,
# domain-name, domain-name-servers, host-name,
domain-name, host-name,
netbios-name-servers, netbios-scope;
#Line added to make OpenDNS my permanent DNS
supersede domain-name-servers 208.67.222.222, 208.67.220.220;
-
- Posts: 12
- Joined: 03 Aug 2009, 13:26
Re: [Fixed] Permanently change DNS
It's been working flawlessly for a couple of months now.
Re: [Fixed] Permanently change DNS
Sorry to bump this tread up....
I want to use OpenDns as my dns-server and found this tread.
I ssh:ed over to my B2 and did a as root but didn't find a dhcpclient.conf.
Is it safe to make one?
I want to use OpenDns as my dns-server and found this tread.

I ssh:ed over to my B2 and did a
Code: Select all
ls /etc/dhcp3/
Is it safe to make one?
-
- Posts: 904
- Joined: 09 Oct 2009, 18:49
Re: [Fixed] Permanently change DNS
The files in question have changed it would seem. You need to edit /etc/dhcp/dhclient.conf.
Re: [Fixed] Permanently change DNS
hmmm changed my /etc/dhcp/dhclient.conf to
and ran /sbin/dhclient eth0 and waited för a couple of hours but my dns-servers didn't change...
Code: Select all
request subnet-mask, broadcast-address, time-offset, routers,
# domain-name, domain-name-servers, host-name,
domain-name, host-name,
netbios-name-servers, netbios-scope;
supersede domain-name-servers 208.67.222.222, 208.67.220.220;
timeout 10;
lease {
interface "eth1";
fixed-address 192.168.10.1;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.10.255;
option routers 192.168.10.1;
renew 6 2029/1/10 13:58:18;
rebind 3 2029/7/18 06:11:04;
expire 2 2038/1/19 03:14:07;
}
send host-name "b2";
Re: [Fixed] Permanently change DNS
I don't think the hash tag is valid there. If you want to keep that line, you should move it out of the sequence.
I really can't comment on the "supersede" directive. I changed the request directive in my own dhclient.conf in a similar war, but I also changed my resolv.conf file manually. I really don't see the point of adding instructions for dhclient to maintain static addresses that I've just told not to touch. And in fact it doesn't, which may be why it's failing because if it's not supposed to touch it than there's also nothing to supersede. There can however be a version dependency on this philosophy: previously it used to mean that a specific setting should always be enforced, while nowadays it is custom to only enforce a setting that is already influenced by some other variable.
Stick to basics: if you want to manually maintain DNS lookup configuration (i.e. the contents of /etc/resolv.conf) and some other process keeps changing it, stop the other process from changing it - don't tell that other process to fill it with the information you desire.
I really can't comment on the "supersede" directive. I changed the request directive in my own dhclient.conf in a similar war, but I also changed my resolv.conf file manually. I really don't see the point of adding instructions for dhclient to maintain static addresses that I've just told not to touch. And in fact it doesn't, which may be why it's failing because if it's not supposed to touch it than there's also nothing to supersede. There can however be a version dependency on this philosophy: previously it used to mean that a specific setting should always be enforced, while nowadays it is custom to only enforce a setting that is already influenced by some other variable.
Stick to basics: if you want to manually maintain DNS lookup configuration (i.e. the contents of /etc/resolv.conf) and some other process keeps changing it, stop the other process from changing it - don't tell that other process to fill it with the information you desire.