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 ! |
@ 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. |
wow, do you have a sample link somewhere ?
i did google and didn't find any samples. thanks ! Quote:
|
@ Reply
|
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, :( |
@ 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. |
T3,
what is "NIC files" ? i'm using ubuntu, never seen things like "PEERDNS, DNS1=..." thanks ! Quote:
|
@ 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:
Code:
[802-3-ethernet] Make sure you take backup of any configuration file before making any changes to it. It is good to be safe then sorry :-) |
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:
|
@ 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> |
Excellent,thanks again ! :)
Quote:
|
@ Reply
You're welcome. Please mark the thread as solved.
Enjoy linux!!! |
All times are GMT -5. The time now is 06:39 AM. |