LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 07-11-2009, 01:42 PM   #1
cstrieder
Member
 
Registered: Sep 2008
Location: Brazil
Distribution: Slackware
Posts: 58

Rep: Reputation: 15
How to setup a default DNS


Hi,

I have done the configuration of the wired network interface eth0 in the file /etc/network/interfaces, and it seems ok:
Code:
#This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# Ethernet
auto eth0
iface eth0 inet static
address 150.163.27.125
netmask 255.255.255.0
network 150.163.27.0
broadcast 150.163.27.255
gateway 150.163.27.254

# Wireless
#auto lo ath0
#iface lo inet loopback
allow-hotplug ath0
iface ath0 inet dhcp
        wpa-driver wext
        wpa-roam /etc/wpa_supplicant.conf

iface wireless_neusa inet dhcp

iface default inet dhcp
But every time I reboot the machine I need to setup the nameserver in the file /etc/resolv.conf.

Is there a way to setup a default nameserver? And what is the file I need to edit for this?
 
Old 07-11-2009, 08:05 PM   #2
watcher69b
Member
 
Registered: Nov 2007
Location: /home/watcher69b
Distribution: RH, Fedora & CentOS
Posts: 552

Rep: Reputation: 41
in the ifcfg-eth0
add

DNS1=x.x.x.x
NAMESERVER=x.x.x.x

/etc/resolv.conf likes DNS1= and ifcfg likes NAMESERVER=
so this makes them both happy
 
Old 07-11-2009, 10:33 PM   #3
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
Quote:
Originally Posted by watcher69b View Post
in the ifcfg-eth0
add

DNS1=x.x.x.x
NAMESERVER=x.x.x.x

/etc/resolv.conf likes DNS1= and ifcfg likes NAMESERVER=
so this makes them both happy
This is Debian (assumed due to the section we're in and the existence of /etc/network/interfaces), not RedHat. ifcfg-eth0 doesn't exist.
 
Old 07-12-2009, 01:30 PM   #4
cstrieder
Member
 
Registered: Sep 2008
Location: Brazil
Distribution: Slackware
Posts: 58

Original Poster
Rep: Reputation: 15
Hi,

I did not understant both posts at all.

I am using Debian Lenny.

I put
Code:
nameserver 150.163.27.9
in the /etc/network/interfaces, but it does not help.

Code:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# Ethernet
auto eth0
iface eth0 inet static
address 150.163.27.125
netmask 255.255.255.0
network 150.163.27.0
broadcast 150.163.27.255
gateway 150.163.27.254
nameserver 150.163.27.9

# Wireless
#auto lo ath0
#iface lo inet loopback
allow-hotplug ath0
iface ath0 inet dhcp
        wpa-driver wext
        wpa-roam /etc/wpa_supplicant.conf

iface wireless_neusa inet dhcp

iface default inet dhcp
Any ideas?
 
Old 07-16-2009, 04:22 PM   #5
scrooge74
LQ Newbie
 
Registered: Jul 2009
Location: out there
Distribution: debian/ubuntu
Posts: 9

Rep: Reputation: 2
You need to prepend the DNS address in /etc/dhcp3/dhclient.conf

prepend domain-name-servers 208.67.222.222,208.67.220.220;

those are OpenDNS servers, you can put any other if you want
 
Old 07-18-2009, 03:41 PM   #6
cstrieder
Member
 
Registered: Sep 2008
Location: Brazil
Distribution: Slackware
Posts: 58

Original Poster
Rep: Reputation: 15
Hi scrooge74,

I am trying what you say.

Do you know if it works with more then 2 dns addresses?

Thanks.
 
Old 07-19-2009, 08:50 AM   #7
scrooge74
LQ Newbie
 
Registered: Jul 2009
Location: out there
Distribution: debian/ubuntu
Posts: 9

Rep: Reputation: 2
Quote:
Originally Posted by cstrieder View Post
Hi scrooge74,

I am trying what you say.

Do you know if it works with more then 2 dns addresses?

Thanks.

Well open dns instructions are to use both of them (one is backup) and if you remember in XP you had two spots for the same.

Here you can check the instructions
 
  


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
help needed to setup a DNS server can anyone say how to configure a DNS server subha Linux - Networking 4 04-27-2012 11:50 PM
Setting default dns BinarySpike Linux - Server 2 04-16-2008 10:04 AM
dns - default reverse record muha Linux - Networking 2 08-15-2007 02:10 AM
BIND DNS Default Host movitto Linux - Networking 1 03-19-2006 06:02 PM
default page for domains hosted on my DNS marsguy Linux - Software 2 09-19-2005 09:24 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 04:52 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
Open Source Consulting | Domain Registration