LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-11-2011, 03:51 AM   #1
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 610

Rep: Reputation: 31
How to add DNS IP address through terminal ?


Hi,
In Red Hat Linux GUI interface i know that under Network Configuration there is a DNS tab and there I want write my DNS IP address.
Well I want to add DSN entries through command line. which file should I edit and write

Primary DNS:
Secondary DNS:
Teriary DNS:

thanks
garden
 
Old 01-11-2011, 04:01 AM   #2
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,527

Rep: Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898
Edit
Quote:
/etc/resolv.conf
Quote:
nameserver xxx.xxx.xxx.xxx
nameserver xxx.xxx.xxx.xxx
nameserver xxx.xxx.xxx.xxx
Kind regards
 
Old 01-11-2011, 04:06 AM   #3
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 610

Original Poster
Rep: Reputation: 31
thanks for reply .well what about # etc/sysconfig/network file.What is the purpose of this file ?
 
Old 01-11-2011, 04:08 AM   #4
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,527

Rep: Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898
Quote:
Originally Posted by gardenair View Post
thanks for reply .well what about # etc/sysconfig/network file.What is the purpose of this file ?
http://www.faqs.org/docs/securing/chap9sec93.html

Kind regards
 
Old 01-11-2011, 05:36 AM   #5
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 610

Original Poster
Rep: Reputation: 31
thanks "repo" for the reply.About gateway it clear but when we go to # cat /etc/host i can see
Code:
127.0.0.1 localhost.localdomain localhost
what this files do ? Actually i am confuse about /etc/resolv.conf and /etc/hosts file.
By default after fresh installation in GUI interface under Network Configuration DNS tab i can see Hostname as
localhost.localdomain and this can be viewed in
Code:
cat /etc/hosts
file as following
Code:
127.0.0.1 localhost.localdomain localhost
This indicate what ever i check that in /etc/hosts reflect what ever i see in GUI INTERFACE.
So to put DNS IP address in this file is wrong ?
Please again guide me .
thanks
 
Old 01-11-2011, 05:40 AM   #6
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,527

Rep: Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898
Quote:
So to put DNS IP address in this file is wrong ?
Yes, resolv.conf is the place to put your DNS
You can however use the hosts file to put some isolated nodes.
See
http://linux.die.net/man/5/hosts

Kind regards
 
Old 01-11-2011, 05:50 AM   #7
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 610

Original Poster
Rep: Reputation: 31
so
Code:
/etc/resolv.conf
well it means the word nameserver is the keyword for linux and just ahead we have to assign our DNS IP address ?
Example

Quote:
nameserver 192.168.1.200
nameserver 192.168.1.201
nameserver 192.168.1.202
where

192.168.1.200 is primary DNS,192.168.1.201 is Secondary DNS and 192.168.1.202 is Tretiary DNS
I am sure now i am correct!
thanks
 
Old 01-11-2011, 05:55 AM   #8
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,527

Rep: Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898
As long as the ip's are from a dns server, it's correct.

Kind regards
 
Old 01-11-2011, 05:59 AM   #9
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 610

Original Poster
Rep: Reputation: 31
thanks "repo" a lot
one thing which i want to confirm again that nameserver is a keyword here or it can be as anything else

# vi /etc/resolv.conf

Quote:
nameserver 192.168.1.200
nameserver 192.168.1.201
nameserver 192.168.1.202
yes i know that ip's should be from a dns server,

Last edited by gardenair; 01-11-2011 at 06:07 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Add new encoding to terminal plamensl Linux - Desktop 1 12-08-2010 03:18 PM
how to add a new IP address ? marozsas Red Hat 5 09-16-2009 02:31 PM
add new terminal kant992@gmail.com Linux - Server 1 07-26-2009 11:26 AM
Router gateway address being picked up as primary DNS address under SuSe Hubmasterflex Linux - Networking 13 10-18-2008 02:40 PM
How to automatically add an address to the address book in Thunderbird royeo Linux - Newbie 2 09-04-2006 04:51 PM


All times are GMT -5. The time now is 06:45 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration