Debian This forum is for the discussion of Debian Linux.
|
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
03-16-2009, 11:12 AM
|
#1
|
LQ Newbie
Registered: Mar 2009
Posts: 19
Rep:
|
config dns server
hello, I'm using debian 5 and I'm trying to configure the dns server for my machine.
I've already set static IP for my machine then tried to set up the dns server. But either i tried by GUI or by command-line all the ips of dns server disappeared each time i reboot the system
can anybody tell me how to fix the dns server for my machine using command-line?
I tried with the file /etc/resolv.conf but it just works before i reboot. after that, everthing is removed!
|
|
|
03-16-2009, 11:41 AM
|
#2
|
LQ Guru
Registered: Dec 2008
Location: Westgate-on-Sea, Kent, UK
Distribution: Debian Testing Amd64
Posts: 5,465
Rep:
|
Quote:
Originally Posted by tuananh87vn
hello, I'm using debian 5 and I'm trying to configure the dns server for my machine.
I've already set static IP for my machine then tried to set up the dns server. But either i tried by GUI or by command-line all the ips of dns server disappeared each time i reboot the system
can anybody tell me how to fix the dns server for my machine using command-line?
I tried with the file /etc/resolv.conf but it just works before i reboot. after that, everthing is removed!
|
Assuming you're using dhcp, edit the /etc/dhcp3/dhclient.conf file.
Add the line:
Code:
prepend domain-name-servers dns-server1,dns-server2;
where you replace dns-server1 and 2 by the ip number of the dns servers you want to use. My ISP would override anything I put in resolv.conf or /etc/network/interfaces but it can't override the prepend statement in dhclient.conf. heh heh heh.
cheers,
jdk
|
|
|
03-16-2009, 12:21 PM
|
#3
|
LQ Newbie
Registered: Mar 2009
Posts: 19
Original Poster
Rep:
|
thanks, but if dhcp is not used, I set static IP instead. It doesn't seem to work =.=
|
|
|
04-09-2009, 07:04 AM
|
#4
|
LQ Newbie
Registered: Mar 2009
Posts: 19
Original Poster
Rep:
|
guys,
why in some debian machines, the dns server is set static, which will not change each time I reboot the machine. the /etc/resolve.conf has nothing but the nameserver defined
but in my debian machine, dns servers are lost each time of rebooting. i notice there's comment like "DON'T EDIT THIS FILE BY HAND... WILL BE OVERWRITTEN" in /etc/resolve.conf => is it something like dns setting is still automatic, not manual?
what's fucked up with my machine? I'm fed up with having to re-configure the dns server each time turn on the machine in order to have internet connection.
Give me hands, plz!!!
thanks!
Last edited by tuananh87vn; 04-09-2009 at 07:06 AM.
|
|
|
04-09-2009, 11:05 AM
|
#5
|
Member
Registered: Feb 2006
Distribution: Debian Sid
Posts: 792
|
Sounds like you are still running dhcp.
Please post the contents of /etc/network/interfaces
|
|
|
04-09-2009, 12:15 PM
|
#6
|
LQ Newbie
Registered: Mar 2009
Posts: 19
Original Poster
Rep:
|
Quote:
Originally Posted by norobro
Sounds like you are still running dhcp.
Please post the contents of /etc/network/interfaces
|
here we go
Quote:
# 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
# The primary network interface
allow-hotplug eth0
iface eth0 inet static
address 192.168.1.111
netmask 255.255.255.0
gateway 192.168.1.1
auto eth0
|
I guess I've already made it static
Last edited by tuananh87vn; 04-09-2009 at 12:17 PM.
|
|
|
04-09-2009, 03:29 PM
|
#7
|
Member
Registered: Feb 2006
Distribution: Debian Sid
Posts: 792
|
I know that dhclient-script overwrites resolv.conf each time that it is run. Thought maybe you still had a dhcp statement in your "interfaces" file.
My "interfaces" file is essentially the same as yours except that "auto eth0" comes before the static configuration statements. I don't know if that makes a difference.
Code:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
auto lo eth0
iface lo inet loopback
mapping eth0
script grep
map eth0
allow-hotplug eth0
iface eth0 inet static
address 192.168.2.2
netmask 255.255.255.0
gateway 192.168.2.1
broadcast 192.168.2.255
|
|
|
04-09-2009, 04:59 PM
|
#8
|
LQ Guru
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Rep:
|
I don't think you need both auto eth0 and allow-hot-plug eth0 that's redundant imho..
Other than that, nothing jumps out at me..
I commented out allow-hotplug eth0 and replaced it with auto eth0 so without question the interface always comes up.
I would use allow-hotplug if I had a PCMCIA or USB network interface that may or may not be present.
I can't say that is what is causing your issue though, since it does appear to be configured as a static IP
Quote:
Lines beginning with the word "auto" are used to identify the physical interfaces to be brought up when ifup is run with the -a option.
Lines beginning with "allow-" are used to identify interfaces that should be brought up automatically by various subsytems.
|
|
|
|
04-10-2009, 05:01 AM
|
#9
|
LQ Newbie
Registered: Mar 2009
Posts: 19
Original Poster
Rep:
|
awww, i comment out both allow-hot-plug and auto eth0 yet another auto eth0 appears right when I restart the network... thing still doesn't work =.=
|
|
|
04-10-2009, 09:24 AM
|
#10
|
LQ Guru
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Rep:
|
appears ? you mean the interfaces file is being altered automatically ?
is network-manager installed ? if so rip out that piece of junk.. it's probably fighting you, and making changes willy nilly to your network configs.
aptitude purge network-manager
then see what happens.
|
|
|
04-10-2009, 10:24 AM
|
#11
|
Senior Member
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100
Rep:
|
I thought this problem (random DHCP client problems) was solved years ago, but maybe its making a comeback? It used to be (by used to be I'm talking about Debian Woody and Sarge, v3.0 and v3.1) that if you ever used DHCP to get addresses, DHCP client would still run, even after you set the machine to use static addresses. You have at least a DHCP client installed to have received a DHCP address. Try removing that with apt-get/aptitude/dpkg or whatever you use to install/uninstall packages. I believe the current DHCP client package is dhcp3-client, which is what I'm suggesting you remove. See what you have installed with the command:
Code:
dpkg --list |grep dhcp
Peace,
JimBass
|
|
|
All times are GMT -5. The time now is 08:33 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|