LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 06-20-2015, 03:42 AM   #1
dzonny
LQ Newbie
 
Registered: Jun 2015
Posts: 2

Rep: Reputation: Disabled
CentOS 6.6 with 2 network cards with different DNS settings


Hi!

I have two network cards in my CentOS and I need configure different DNS servers for each of them. Both are public but they have different IP provider.

I tried to set eth0 in /etc/sysconfig/network-scripts/ifcfg-eth0 and eth1 in /etc/sysconfig/network-scripts/ifcfg-eth1 with different DNS1 and DNS2, but when I do "ifup eth1", DNS of eth0 are removed from /etc/resolf.conf and eth0 stops responding. And when I do "ifup eth0", eth1 stops responding too.

I tried to define in eth1 config RESOLV_MODS="no" but it didn't help.

I suppose I need set routing or something like this. Now I don't know a right way. Any ideas?

Thanks very much.
 
Old 06-20-2015, 05:36 AM   #2
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS, Manjaro
Posts: 5,806

Rep: Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777
Just off the top, but I think you cannot do that.
DNS/BIND was never intended to be interface specific in that way, it is more an IP stack thing. As such, all networking uses the same lookup settings. You can put both DNS in your nameserver list, but it will always try the first entry first, then failover to the second if the first does not respond.

I take it that both DNS servers respond with some private network addresses that are not shared for public resolution, as there is no other good reason to use both. All of my work DNS servers are public and authoritative for the domain, except my home server. I can resolve names in my domains from public DNS servers like 8.8.8.8 at google. The only reason for having the local one in the list is that it is faster (being local network, 1000bt) and the dns traffic is reduced out my cable modem.

Can you expound upon why you would want this split DNS setup? I would like to verify my thoughts upon this, and see if we can arrive at a solution that will serve.
 
Old 06-20-2015, 08:24 AM   #3
dzonny
LQ Newbie
 
Registered: Jun 2015
Posts: 2

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by wpeckham View Post
Just off the top, but I think you cannot do that.
DNS/BIND was never intended to be interface specific in that way, it is more an IP stack thing. As such, all networking uses the same lookup settings. You can put both DNS in your nameserver list, but it will always try the first entry first, then failover to the second if the first does not respond.

I take it that both DNS servers respond with some private network addresses that are not shared for public resolution, as there is no other good reason to use both. All of my work DNS servers are public and authoritative for the domain, except my home server. I can resolve names in my domains from public DNS servers like 8.8.8.8 at google. The only reason for having the local one in the list is that it is faster (being local network, 1000bt) and the dns traffic is reduced out my cable modem.

Can you expound upon why you would want this split DNS setup? I would like to verify my thoughts upon this, and see if we can arrive at a solution that will serve.
I want this because I need change my IP provider. And my plan is new card with new IP and settings. Then I'm going to tell my clients to change their domains settings. And finally, I will cancel the original IP and network card.
Everything will be without any downtime.

That is why I want to keep running two network cards with different DNS settings. But only a few days.
 
Old 06-21-2015, 05:53 AM   #4
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS, Manjaro
Posts: 5,806

Rep: Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777
Changing ISP

I see. You are not just changing ISP, but migrating slowly from the old to the new. That IS the hard way, but I can see why you would.

What I do NOT see if why you would want to use both DNS servers. Are there addresses that will resolve differently between them? If they resolve everything the same, just use the old one until clients are moving to the new ISP address, then use the new one. When all traffic is off the old ISP connection, drop it. The more important question is about when you change your default route, but that is a different subject.

As long as there are no addresses they resolve differently, it matters that the nameserver you use WORKS. There is not a different internet with different addresses out the two connections.
 
Old 06-23-2015, 02:18 PM   #5
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,027

Rep: Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632
https://access.redhat.com/documentat...nterfaces.html
 
  


Reply


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
Centos 6 (64) IPTABLES 3 network cards, odd issue, new to linuxish harroyou Linux - Newbie 1 03-22-2012 05:48 PM
Centos network settings and ownership Jsaren Linux - Newbie 6 05-22-2011 05:24 PM
DNS settings on a local network JJJCR Linux - Networking 3 12-17-2010 02:16 AM
Network settings / DNS Server settings uid0sd Linux - Newbie 3 02-22-2007 03:39 PM
FC2: DNS network settings for wireless Kropotkin Fedora 8 12-29-2004 08:44 PM

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

All times are GMT -5. The time now is 12:54 AM.

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