LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 02-15-2006, 09:41 PM   #1
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Rep: Reputation: 56
About /etc/resolv.conf


Hi folks,

I need to set following nameservers permanent on /etc/resolv.conf e.g.
Code:
nameserver 222.222.222.222
nameserver 111.111.111.111
Because my ISP always assign;
nameserver 111.111.111.111 (primary)
nameserver 222.222.222.222 (secondary)

the primary having problem. I need to revert their order.

On /etc/sysconfig/network-scripts/ifcfg-xxx
Code:
# Please read /usr/share/doc/initscripts-*/sysconfig.txt
# for the documentation of these parameters.
IPV6INIT=no
USERCTL=no
PEERDNS=yes
TYPE=xDSL
DEVICE=ppp0
BOOTPROTO=dialup
PIDFILE=/var/run/pppoe-adsl.pid
FIREWALL=NONE
PING=.
PPPOE_TIMEOUT=80
LCP_FAILURE=3
LCP_INTERVAL=20
CLAMPMSS=1412
CONNECT_POLL=6
CONNECT_TIMEOUT=60
PERSIST=no
SYNCHRONOUS=no
DEFROUTE=yes
USER='satimis_lms@icare.com.hk'
ETH=eth0
PROVIDER=Icare_BB
DEMAND=no
ONBOOT=yes
Whether change both;
Code:
USERCTL=no
PEERDNS=yes
to
Code:
USERCTL=yes
PEERDNS=no
or only changing "PEERDNS=no"

I read "/usr/share/doc/initscripts-*/sysconfig.txt" but I am not very clear.

Please advise. TIA

B.R.
satimis
 
Old 02-16-2006, 12:32 AM   #2
cdjc
LQ Newbie
 
Registered: Sep 2003
Posts: 5

Rep: Reputation: 0
Set PEERDNS to "no"

Code:
PEERDNS=no
Then, restart your network and edit resolv.conf to match what you want.
 
Old 02-16-2006, 01:42 AM   #3
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Original Poster
Rep: Reputation: 56
Hi cdjc,

Tks for your advice. It works.

Steps performed as follows;

1) edited /etc/sysconfig/network-scripts/ifcfg-xxx
2) Set PEERDNS=no
3) ran
# /etc/rc.d/init.d/network restart
4) edited /etc/resolv.conf
typing nameservers as needed there

That is all.

Tested with;
# /etc/rc.d/init.d/network restart
twice to confirm /etc/resolv.conf not overwritten.

Tks.

What are following nameservers;
Code:
nameserver 218.102.32.208
nameserver 203.198.23.208
After editing /etc/sysconfig/network-scripts/ifcfg-xxx I found
them on; /etc/resolv.conf on fisrt restarting;
/etc/rc.d/init.d/network

But the broadband connected. Ping them found they were working without packet loss

B.R.
satimis

Last edited by satimis; 02-16-2006 at 01:46 AM.
 
Old 02-16-2006, 10:32 AM   #4
thew00t
LQ Newbie
 
Registered: Feb 2004
Distribution: Slackware 9.1 and BSD 5.2
Posts: 28

Rep: Reputation: 16
Quote:
Originally Posted by satimis
What are following nameservers;
Code:
nameserver 218.102.32.208
nameserver 203.198.23.208
After editing /etc/sysconfig/network-scripts/ifcfg-xxx I found
them on; /etc/resolv.conf on fisrt restarting;
/etc/rc.d/init.d/network
Hi Satimis, looks like your name servers given there point to http://www.netvigator.com/ Seems to be a broadband supplier/web portal...the site's default language is Chinese.

w00t

Last edited by thew00t; 02-16-2006 at 10:33 AM.
 
Old 02-16-2006, 06:25 PM   #5
Jaxån
Member
 
Registered: Apr 2005
Location: Sweden
Distribution: Debian
Posts: 142

Rep: Reputation: 15
I don't think it realy matter which order you put name servers in /etc/resolv.conf

The propper way to use one or more servers is to load balance between them. That is, with two servers, the questions should be divided between them, even if one is down or has other problems.

So your solution would be to dropp 111.111.111.111 all together and only use 222.222.222.222
 
Old 02-16-2006, 07:36 PM   #6
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Original Poster
Rep: Reputation: 56
Hi Jaxån,

Tks for your advice.

Quote:
The propper way to use one or more servers is to load balance between them.
I'm running a workstation only.

I put them on /etc/resolv.conf just reverting their order. In case my ISP fixes the problem I have 2 nameservers there switching between them.

B.R.
satimis
 
Old 02-16-2006, 08:03 PM   #7
Jaxån
Member
 
Registered: Apr 2005
Location: Sweden
Distribution: Debian
Posts: 142

Rep: Reputation: 15
You might have missunderstod me. I wasn't that clear in my answer to you.

The servers I mean in my answer is the dns servers your ISP gives you.

If you have two DNS servers in your /etc/resolv.conf, your machine should ask each one every second time. That is, first DNS question should go to 111.111.111.111, next DNS question to 222.222.222.222, third to 111.111.111.111 and so on.

So you can't tell your machine (without a hack any way) to ask only 111.111.111.111 and only 222.222.222.222 when 111.111.111.111 has problems (which ever that could be).

So it doesn't matter which order you specify your DNS-servers in /etc/resolv.conf You will hit the bad server with problems each second time you do a DNS-question whichever order you use.

Last edited by Jaxån; 02-16-2006 at 08:04 PM.
 
Old 02-16-2006, 08:58 PM   #8
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Original Poster
Rep: Reputation: 56
Hi thew00t,

Quote:
Seems to be a broadband supplier/web portal...
Noted with tks.

satimis
 
Old 02-16-2006, 09:06 PM   #9
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Original Poster
Rep: Reputation: 56
Hi Jaxån,

Quote:
So you can't tell your machine (without a hack any way) to ask only 111.111.111.111 and only 222.222.222.222 when 111.111.111.111 has problems (which ever that could be)
I expect it hits the 2nd nameserver assigned first.

Which option shall I set on /etc/sysconfig/network-scripts/ifcfg-xxx
Code:
# Please read /usr/share/doc/initscripts-*/sysconfig.txt
# for the documentation of these parameters.
IPV6INIT=no
USERCTL=no
PEERDNS=yes
TYPE=xDSL
DEVICE=ppp0
BOOTPROTO=dialup
PIDFILE=/var/run/pppoe-adsl.pid
FIREWALL=NONE
PING=.
PPPOE_TIMEOUT=80
LCP_FAILURE=3
LCP_INTERVAL=20
CLAMPMSS=1412
CONNECT_POLL=6
CONNECT_TIMEOUT=60
PERSIST=no
SYNCHRONOUS=no
DEFROUTE=yes
USER='satimis'
ETH=eth0
PROVIDER=xxx
DEMAND=no
ONBOOT=yes
TIA

B.R.
satimis
 
Old 02-17-2006, 11:14 AM   #10
Jaxån
Member
 
Registered: Apr 2005
Location: Sweden
Distribution: Debian
Posts: 142

Rep: Reputation: 15
You can't select order to ask or which name server to ask first hand.
Your system will ask each name server in turn. One after the other in a round robin way. No option (that I know of any way).

If you don't want to use a name server, don't put it in /etc/resolv.conf

Oh yes, you need to tell pppd to not set dns server in /etc/resolv.conf by seting PEERDNS to no, as you have been told earlier. If you have PEERDNS=yes, pppd will ask for a list of DNS servers when you connect and use them.
That is if you use pppd or dhcp to get internet connection. Isn't it documented in /usr/share/doc/initscripts-*/sysconfig.txt ?

But this look like a Red Hat type of configuration. And I only uses Debian. But the way name reolution behaves is the same between RH and Debian. It's only the way system configuration is set up that is different.

Last edited by Jaxån; 02-17-2006 at 11:24 AM.
 
Old 02-24-2006, 09:30 PM   #11
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Original Poster
Rep: Reputation: 56
Hi Jaxån,

Quote:
And I only uses Debian. But the way name reolution behaves is the same between RH and Debian. It's only the way system configuration is set up that is different.
Yes, it is the same. I got it. Tks

B.R.
satimis
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
resolv.conf Snump Mandriva 54 10-31-2004 04:16 PM
/etc/resolv.conf Pedroski Linux - Networking 1 06-22-2004 10:03 AM
resolv.conf jmdlcar Slackware 9 05-15-2004 11:44 AM
resolv.conf ricemark20 Linux - Networking 12 11-11-2003 04:08 PM
Resolv.conf tristan_vdv Linux - Networking 2 11-20-2001 06:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:11 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration