LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 01-12-2012, 04:15 PM   #1
5883
Member
 
Registered: Aug 2004
Posts: 173

Rep: Reputation: 0
Without NetworkManager, how to keep the DNS info for both NICs ?


say i don't have NetworkManager in the embedded linux,
all i have is /etc/resolv.conf for DNS, if i understand this correctly.

Now i have 2 NICs may connect to 2 different networks,
can i save the DNS info separately ?

Many thanks !
 
Old 01-12-2012, 04:46 PM   #2
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
@ Reply

Hi 5883,

You can specify the DNS in your network interface configuration file. You can specify DNS using following param:

DNS1=xxx.xxx.xxx.xxx
DNS2=xxx.xxx.xxx.xxx

Just make sure PEERDNS is set to NO otherwise it will update resolv.conf file with this information.
 
Old 01-12-2012, 05:53 PM   #3
5883
Member
 
Registered: Aug 2004
Posts: 173

Original Poster
Rep: Reputation: 0
wow, do you have a sample link somewhere ?
i did google and didn't find any samples.
thanks !

Quote:
Originally Posted by T3RM1NVT0R View Post
Hi 5883,

You can specify the DNS in your network interface configuration file. You can specify DNS using following param:

DNS1=xxx.xxx.xxx.xxx
DNS2=xxx.xxx.xxx.xxx

Just make sure PEERDNS is set to NO otherwise it will update resolv.conf file with this information.
 
Old 01-13-2012, 12:27 AM   #4
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
@ Reply

You're welcome!

Here is the sample link: http://www.mombu.com/gnu_linux/mandr...f-1508104.html
 
Old 01-13-2012, 12:25 PM   #5
5883
Member
 
Registered: Aug 2004
Posts: 173

Original Poster
Rep: Reputation: 0
well, not sure i get it right, this is ubuntu, kernel 2.6.32

===== my /etc/network/interfaces =====
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

auto eth1
iface eth1 inet static
address 4.5.182.182
netmask 255.255.252.0
gateway 4.50.183.254
dns-nameservers 4.2.8.9


After reboot, my /etc/resolv.comf is still
nameserver 10.38.78.5
nameserver 10.38.58.5
domain thiscompany.ad
search thiscompany.ad

i'm not seeing my 4.2.8.9,
 
Old 01-13-2012, 12:32 PM   #6
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
@ Reply

If you want the NIC files to update resolve.conf then put the following entry in NIC:

PEERDNS=yes
DNS1=xxx.xxx.xxx.xxx

and then it should update your resolv.conf file.

Make sure that you take a backup of the files before editing.
 
Old 01-13-2012, 06:37 PM   #7
5883
Member
 
Registered: Aug 2004
Posts: 173

Original Poster
Rep: Reputation: 0
T3,

what is "NIC files" ?
i'm using ubuntu, never seen things like "PEERDNS, DNS1=..."

thanks !

Quote:
Originally Posted by T3RM1NVT0R View Post
If you want the NIC files to update resolve.conf then put the following entry in NIC:

PEERDNS=yes
DNS1=xxx.xxx.xxx.xxx

and then it should update your resolv.conf file.

Make sure that you take a backup of the files before editing.
 
Old 01-14-2012, 06:29 AM   #8
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
@ Reply

Alright so you are using Ubuntu. That clear up the things a bit. I have checked this on my Ubuntu 11.04 system and here is the location where you should look for:

Quote:
/etc/NetworkManager/system-connections
Under this you will find out the connection files for your Wired Connection as well as Wireless Connection. I am using wired connection so I have got a file with the name Wired Connection 1. When I did a cat on this file here is the output that I got:

Code:
[802-3-ethernet]
duplex=full
mac-address=xx:xx:xx:xx:xx:xx

[connection]
id=Wired connection 1
uuid=0acd594e-89a1-402a-9610-deecb10e766e
type=802-3-ethernet
timestamp=3548542633

[ipv6]
method=auto

[ipv4]
method=manual
dns=192.168.1.1;
addresses1=192.168.1.20;24;192.168.1.1;
I will explain the [ipv4] section as that is the section where you need to edit the stuff. method=manual it means I have statically setup my ip address. dns=192.168.1.1 is my dns server which this interface will going to use. addresses1=192.168.1.20 is the IP I have configured on this machine. 24 is the subnet mask in use. 192.168.1.1 is also acting as my default gateway.

Make sure you take backup of any configuration file before making any changes to it. It is good to be safe then sorry :-)
 
1 members found this post helpful.
Old 01-14-2012, 09:40 AM   #9
5883
Member
 
Registered: Aug 2004
Posts: 173

Original Poster
Rep: Reputation: 0
T3, 1st of all thanks very much for spending time looking into this.

i looked at networkManager before, but there's 1 issue blocking me from using it.
For our app, we have to make network changes in the command line, meaning we have to manually
edit the "Auto eth0", "Auto eth1" files under the /etc/NetworkManager folder.

But if you do a fresh install of ubuntu, i don't see these files,
until i click the up/down arrow icon in the right corner of the desktop, that's to bring down/up the network.

So for me, since i cannot access the desktop, i need to manually generate the "Auto eth0".
Then i can edit the ip address etc.

But there's a "uuid" field, i did't know where to get it. So i stopped there.

Our app will be running in the embedded board, that's why i have to use command line.

Quote:
Originally Posted by T3RM1NVT0R View Post
Alright so you are using Ubuntu. That clear up the things a bit. I have checked this on my Ubuntu 11.04 system and here is the location where you should look for:



Under this you will find out the connection files for your Wired Connection as well as Wireless Connection. I am using wired connection so I have got a file with the name Wired Connection 1. When I did a cat on this file here is the output that I got:

Code:
[802-3-ethernet]
duplex=full
mac-address=xx:xx:xx:xx:xx:xx

[connection]
id=Wired connection 1
uuid=0acd594e-89a1-402a-9610-deecb10e766e
type=802-3-ethernet
timestamp=3548542633

[ipv6]
method=auto

[ipv4]
method=manual
dns=192.168.1.1;
addresses1=192.168.1.20;24;192.168.1.1;
I will explain the [ipv4] section as that is the section where you need to edit the stuff. method=manual it means I have statically setup my ip address. dns=192.168.1.1 is my dns server which this interface will going to use. addresses1=192.168.1.20 is the IP I have configured on this machine. 24 is the subnet mask in use. 192.168.1.1 is also acting as my default gateway.

Make sure you take backup of any configuration file before making any changes to it. It is good to be safe then sorry :-)
 
Old 01-14-2012, 10:03 AM   #10
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
@ Reply

To get the UUID you need to find out the device file attached with your ethernet device. And then you can run the following command to get the UUID:

Code:
blkid <device_file>
 
1 members found this post helpful.
Old 01-14-2012, 10:50 AM   #11
5883
Member
 
Registered: Aug 2004
Posts: 173

Original Poster
Rep: Reputation: 0
Excellent,thanks again !

Quote:
Originally Posted by T3RM1NVT0R View Post
To get the UUID you need to find out the device file attached with your ethernet device. And then you can run the following command to get the UUID:

Code:
blkid <device_file>
 
Old 01-14-2012, 10:51 AM   #12
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
@ Reply

You're welcome. Please mark the thread as solved.

Enjoy linux!!!
 
  


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
Problem with cached dns when using networkmanager marales314 Linux - Networking 1 06-20-2011 01:09 AM
GNOME NetworkManager not displaying DNS Servers in openSUSE 11 swampdog2002 SUSE / openSUSE 0 06-29-2008 02:59 PM
NetworkManager & gprs/ppp DNS: after using wlan/eth0, DNS for ppp doesn't work mtess Linux - Networking 3 03-12-2008 03:31 PM
config DNS w/NetworkManager, DHCP otoomet Linux - Networking 2 09-30-2007 07:58 AM
SuSE 9.0 Two NICs, only first assigned DNS mwooten111 Linux - Distributions 1 04-21-2004 09:56 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 04:44 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