LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   OpenDNS (https://www.linuxquestions.org/questions/slackware-14/opendns-551356/)

adriv 05-04-2007 05:12 PM

OpenDNS
 
Hi,

I've been trying to get OpenDNS working on my Slackbox...
Situation:
Two computers (Slack and Ubuntu/W2000) are connected via a router (Speedtouch 546) to the internet. Both using DHCP with their static IP's.
I got it going on Ubuntu, but not on Slackware, at least, not for longer than a reboot. ;)
I tried netconfig and it works (using static IP's, instead of DHCP), but after a reboot, there is no connection (after setting the router up for static IP's).

From the site of OpenDNS:
Quote:

Using OpenDNS with DHCP

If you assign your computer's IP with DHCP, it probably overwrites your /etc/resolv.conf. Here's how to fix that:

1. Run: sudo gedit /etc/dhcp3/dhclient.conf
2. Change the prepend line to read:
Code:

prepend domain-name-servers 208.67.222.222, 208.67.220.220;
This will prepend the OpenDNS addresses to the top of the list. (You can also use "supersede", which will just use them.) You don't have to worry about the DHCP client overwriting settings on each reboot or lease cycle, and your ISP nameservers will still be used as backup.
3. Run: sudo /etc/init.d/networking restart
But this is not the way it works on Slack. Anyone who has an idea how to get this working?

theoffset 05-04-2007 05:40 PM

Well, Slackware doesn't use dhclient, but dhcpcd.

(Assuming you haven't modified heavily your rc.inet1 file and you're running slack 11.0 (10.2?)) Try editing /etc/rc.d/rc.inet1.conf and adding
Code:

DHCP_KEEPRESOLV[0]="yes"
(You might have to change the array index appropiately).

That should tell dhcp to don't mess with your /etc/resolv.conf.
You might have to rewrite that file and most likely run as root "/etc/rc.d/rc.inet1 stop" before editing it and "/etc/rc.d/rc.inet1 start" after.

H_TeXMeX_H 05-04-2007 07:20 PM

Can't you change the router settings ... it's a better solution IMO. I know some routers won't (like mine), because they use an internal or built-in DNS. Ok, it's not really a DNS, but it caches resolves ... so it's similar.

adriv 05-05-2007 06:11 AM

Quote:

Originally Posted by theoffset
Well, Slackware doesn't use dhclient, but dhcpcd.

(Assuming you haven't modified heavily your rc.inet1 file and you're running slack 11.0 (10.2?)) Try editing /etc/rc.d/rc.inet1.conf and adding
Code:

DHCP_KEEPRESOLV[0]="yes"
(You might have to change the array index appropiately).

That should tell dhcp to don't mess with your /etc/resolv.conf.
You might have to rewrite that file and most likely run as root "/etc/rc.d/rc.inet1 stop" before editing it and "/etc/rc.d/rc.inet1 start" after.

Tried it, but no luck, I'm afraid.
After "/etc/rc.d/rc.inet1 start" everything is fine, but rebooting still rewrites /etc/resolv.conf...
I'm probably overlooking something, but what?

adriv 05-05-2007 06:14 AM

Quote:

Originally Posted by H_TeXMeX_H
Can't you change the router settings ... it's a better solution IMO. I know some routers won't (like mine), because they use an internal or built-in DNS. Ok, it's not really a DNS, but it caches resolves ... so it's similar.

I agree, but I've gone through the menu's and manual of the router several times and can't get this configured (if possible at all). If someone has an idea, I'd be grateful (like I said, it's a Speedtouch 546).

SlackDaemon 05-05-2007 06:19 AM

Try setting the /etc/resolv.conf file to immutable after entering the correct DNS entries:

chattr +i /etc/resolv.conf


at least until you come up with a better solution.

adriv 05-05-2007 04:18 PM

I got it going! :)
And indeed, OpenDNS is faster.
Thanks everyone for the hints & tips.

Had to turn off DHCP (off course also in the router) to get it going.
Now my Ubuntu/Windows box don't get connected, but I'll work it out.

adriv 05-05-2007 06:29 PM

Quote:

Originally Posted by adriv
Now my Ubuntu/Windows box don't get connected, but I'll work it out.

Done! :cool:


All times are GMT -5. The time now is 07:33 PM.