Networking Forums

Networking Forums > Computer Networking > Linux Networking > How can I assign static DNS addr?

Reply
Thread Tools Display Modes

How can I assign static DNS addr?

 
 
GS
Guest
Posts: n/a

 
      05-22-2005, 02:22 AM
I have leased ethernet cable for Broadband Internet connection, they
assigned Static Ip addr, also statis DNS server addresses, how to
assign those using Linux commands?.

I assigned Static IP using below command, but DNS I couldn't able to
assign:

ifconfig eth0 addr 192.168.10.231 netmask 255.255.255.0 gw
192.168.10.1.

Do I have to configure any Route?.

Thanks in advance.

 
Reply With Quote
 
 
 
 
Bit Twister
Guest
Posts: n/a

 
      05-22-2005, 02:56 AM
On 21 May 2005 19:22:58 -0700, GS wrote:
> I have leased ethernet cable for Broadband Internet connection, they
> assigned Static Ip addr, also statis DNS server addresses, how to
> assign those using Linux commands?.



Over 190+ flavors of linux.
Please read http://www.catb.org/~esr/faqs/smart-questions.html
Always provide distribution, release when posting questions.
It could help you get better answers.
 
Reply With Quote
 
GS
Guest
Posts: n/a

 
      05-22-2005, 03:07 AM
I apologize for that. It is RH, Release 9.x.

Thanks.

 
Reply With Quote
 
Bit Twister
Guest
Posts: n/a

 
      05-22-2005, 03:31 AM
On 21 May 2005 20:07:50 -0700, GS wrote:
> I apologize for that. It is RH, Release 9.x.


Running Mandrake/Mandriva myself. For default gateway/device

add <==== to your /etc/sysconfig/network

$ cat /etc/sysconfig/network
HOSTNAME=wb.home.invalid
NETWORKING=yes
GATEWAY=192.168.2.1 <============
GATEWAYDEV=eth0 <========
NETWORKING_IPV6=no

For DNS servers

$ cat /etc/resolv.conf
nameserver 63.240.176.198
nameserver 204.127.99.8
nameserver 199.25.157.128
nameserver 66.932.87.2


To test
service network restart


$ route -n # displays route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.2.0 0.0.0.0 255.255.255.0 U 10 0 0 eth0
0.0.0.0 192.168.2.1 0.0.0.0 UG 10 0 0 eth0
^ ^
| |
gateway ip --------' gateway indicator-------'

$ ping -c 1 -w 3 66.94.234.13 # tests routing to yahoo.com
$ ping -c 1 -w 3 yahoo.com # test DNS lookup
 
Reply With Quote
 
James Knott
Guest
Posts: n/a

 
      05-22-2005, 11:13 AM
GS wrote:

> I have leased ethernet cable for Broadband Internet connection, they
> assigned Static Ip addr, also statis DNS server addresses, how to
> assign those using Linux commands?.
>
> I assigned Static IP using below command, but DNS I couldn't able to
> assign:
>
> ifconfig eth0 addr 192.168.10.231 netmask 255.255.255.0 gw
> 192.168.10.1.
>
> Do I have to configure any Route?.


Normally, the setup utility will ask you for those values, when you
configure the ethernet port. However, it is possible to do it manually.
The DNS addresses go into the /etc/resolv.conf file. You can use the route
command, to add a default gateway, using the address the ISP supplies.
There are better ways, depending on your distro.

 
Reply With Quote
 
Moe Trin
Guest
Posts: n/a

 
      05-22-2005, 11:15 PM
In article <(E-Mail Removed)>, Bit Twister wrote:

>$ cat /etc/resolv.conf
>nameserver 63.240.176.198
>nameserver 204.127.99.8
>nameserver 199.25.157.128
>nameserver 66.932.87.2


man 5 resolver

nameserver
Internet address (in dot notation) of a name server that the
resolver should query. Up to MAXNS (see <resolv.h>) name
servers may be listed, one per keyword.

[compton ~]$ grep -h MAXNS `locate resolv.h`
#define MAXNS 3 /* max # name servers we'll track */
nsaddr_list[MAXNS]; /* address of name server */
[compton ~]$

Old guy

 
Reply With Quote
 
Bit Twister
Guest
Posts: n/a

 
      05-22-2005, 11:24 PM
On Sun, 22 May 2005 18:15:39 -0500, Moe Trin wrote:
>
> [compton ~]$ grep -h MAXNS `locate resolv.h`
> #define MAXNS 3 /* max # name servers we'll track */


Yup, when my first two ISP's DNS fail I delete them and keep on
keeping on.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Assign static IP to each switch port Igor Gomes Linux Networking 1 07-18-2008 11:38 PM
Linksys WRT54GL - assign static IP to MAC address? susana73@hotmail.com Wireless Internet 5 08-08-2006 04:00 PM
Can I access a Router which is on private static ip addr from ISP using leased ethernet line? GS Linux Networking 7 10-30-2005 06:52 PM
Can Not Assign A Static IP Scott L. Windows Networking 2 07-20-2005 09:06 AM
DHCP failover to static IP addr Bob Williams Linux Networking 2 10-27-2004 08:15 PM



1 2 3 4 5 6 7 8 9 10 11