LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   setting linux dns (https://www.linuxquestions.org/questions/linux-newbie-8/setting-linux-dns-597325/)

ThinkTank 11-05-2007 02:43 PM

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.

IP: 10.111.108.2
Subnet: 255.255.255.0
Gateway: 10.111.108.1

Primary DNS Server: 10.50.10.10
Secondary DNS Server: 10.50.10.11

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.

Joe

custangro 11-05-2007 03:04 PM

You can do this:

Code:

ifconfig eth0 10.111.108.2 netmask 255.255.255.0 up
route add default gw 10.111.108.1 eth0
vi /etc/resolv.conf

In the resolv.conf file enter your DNS servers IP address:
Code:

nameserver    10.50.10.10
nameserver    10.50.10.11


mrrangerman 11-05-2007 04:06 PM

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

Code:

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



Code:

#My static settings
auto eth0
iface eth0 inet static
        address 192.168.xxx.xxx
        netmask 255.255.255.0
        broadcast 192.168.xxx.225
        gateway 192.168.xxx.xxx

And then like has been stated edit your resolv.conf file and add your name-server.

ThinkTank 11-06-2007 08:16 AM

As suggested all I needed to do was edit my /etc/network/interfaces file to contain the following;

auto eth0
iface eth0 inet static
address 10.111.108.30
netmask 255.255.255.0
gateway 10.111.108.1
dns-nameservers 10.50.10.10 10.50.10.11

Thanks for all your help guys!


All times are GMT -5. The time now is 10:21 PM.