Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 11-05-2007, 02:43 PM   #1
LQ Newbie
Registered: Sep 2007
Posts: 6

Rep: Reputation: 0
setting linux dns

Hello Guys,

Iíve got a requirement on a couple of my debian systems to configure static IP and DNS settings as theyíre being placed into a network environment which doesnít support DHCP so it will be unable to lease its own details.

This is something Iíve not done before with Linux, at least, not successfully :-D so thought Iíd ask you guys your opinions on the best way to handle it. What I can tell you at the moment is that if I use the following settings on my windows notebook then Iím able to connect to the network and internet no trouble at all, so Iím guessing itís simply a case of setting these same details on my voyage system.


Primary DNS Server:
Secondary DNS Server:

Iíll need some nice simple Simon-Says step by steps for doing this otherwise Iím bound to get lost when trying to set it up. I do have some limited experience of modifying my /etc/network/interfaces file but certainly wouldnít say I really know what Iím doing.

Thanks chaps, I look forward to hearing your advice.

Old 11-05-2007, 03:04 PM   #2
Senior Member
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS , RHEL
Posts: 1,979
Blog Entries: 1

Rep: Reputation: 209Reputation: 209Reputation: 209
You can do this:

ifconfig eth0 netmask up
route add default gw eth0
vi /etc/resolv.conf
In the resolv.conf file enter your DNS servers IP address:

Last edited by custangro; 11-05-2007 at 03:05 PM.
Old 11-05-2007, 04:06 PM   #3
Registered: Oct 2007
Location: MI
Distribution: Debian Slackware
Posts: 528

Rep: Reputation: 59
Edit your /etc/network/interfaces

This is what a static network setting will look like.
Make sure you comment out (prefix each line with a # sign) the DHCP setting, don't just delete it.

Like so

# The primary network interface
#allow-hotplug eth0
#iface eth0 inet dhcp

#My static settings 
auto eth0
iface eth0 inet static
And then like has been stated edit your resolv.conf file and add your name-server.
Old 11-06-2007, 08:16 AM   #4
LQ Newbie
Registered: Sep 2007
Posts: 6

Original Poster
Rep: Reputation: 0
As suggested all I needed to do was edit my /etc/network/interfaces file to contain the following;

auto eth0
iface eth0 inet static

Thanks for all your help guys!


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
setting up DNS sjpatel Linux - Networking 4 02-09-2006 02:51 PM
Setting up IPv6 linux DNS Server asurya Linux - Newbie 1 05-23-2005 08:20 AM
help setting DNS itabarau Linux - Newbie 3 02-04-2005 11:29 AM
Setting up DNS UnknownFear Linux - Networking 3 04-10-2004 01:39 AM
Need Help setting up DNS???!!! richhoward Linux - General 13 06-25-2003 04:37 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:07 AM.

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