Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
09-30-2009, 06:19 AM
|
#1
|
|
LQ Newbie
Registered: Sep 2009
Posts: 2
Rep:
|
Choosing DNS server based on domain being queried
Hi,
I've setup a BIND 9 server that sits in multiple subnets and serves different views based on which subnet the query came from. This is working fine.
Now I have a Debian client that sits in two of these subnets and I'd like it to choose which DNS server IP to use based on the domain name in the query, i.e. host.domain would be looked up using DNS server defined for the first network interface, whereas host.foobar.domain would use a different DNS server defined for the second network interface. How should I go about doing this? Resolvconf apparently lets you define dns-nameservers and dns-servers on a per-interface basis, but I can't find any good documentation about how this actually works.
|
|
|
|
09-30-2009, 10:16 AM
|
#2
|
|
LQ Newbie
Registered: Aug 2003
Posts: 25
Rep:
|
I don't believe there is any way to do what you want using only the resolv.conf. I think the easiest solution is to run a caching only name server on your Debian client, then point your client to itself, then use selective forwarding to forward the query to the correct name server.
You'd need to put the following in your named.conf
zone "domain" IN {
type forward;
forwarders {10.0.0.1;};
};
zone "foobar.domain" IN {
type forward;
forwarders {10.0.1.1;};
};
Alternatively, you could setup both your existing name servers to forward queries to each other.
Hope this helps,
Andy
|
|
|
|
10-01-2009, 06:01 AM
|
#3
|
|
LQ Newbie
Registered: Sep 2009
Posts: 2
Original Poster
Rep:
|
Thanks, that solution worked perfectly.
I wonder though if this could have been done using resolvconf package (not resolv.conf file). If you define dns-nameservers and dns-search for an interface using resolvconf, does it automatically know to look for those domains using that interface, or does it simply try appending those suffixes as with resolv.conf search option? In the latter case, how does resolvconf decide which interface to use for sending the queries?
|
|
|
|
10-01-2009, 10:21 AM
|
#4
|
|
LQ Newbie
Registered: Aug 2003
Posts: 25
Rep:
|
I just did some research on the resolvconf package as I was not familiar with it.
There is some information here:
http://en.wikipedia.org/wiki/Resolvconf
and the man page is here:
http://www.clab.it/cgi-bin/man/man2html?resolvconf+8
It appears that the sole purpose of that program is to re-write the resolv.conf based on what interfaces are present on your computer, so this would NOT work for your situation. The only thing that resolvconf would do is deal with situations when you have multiple programs that tend to configure resolv.conf - perhaps you run two dhcpclient programs (one for each interface) and perhaps you also have ppp running to support your connection to the Internet.
The only configuration for resolvconf seems to be the interface-order file. If you look at the man page here:
http://www.clab.it/cgi-bin/man/man2h...nterface-order
You can see that it only supports interface name and not domain name in order to choose which name server to use.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 02:13 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|