Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm using some sort of a dns-proxy service (the details aren't clear but as far as I understand it works by resolving the the domain into a cloud based proxy server and returning it's address whilst configuring it to forward my requests to the actual domain)

what I want to do is to use said DNS only when necessary (i.e. when accessing a specific domain) otherwise use the default resolving method.

I've gone over the resolv.conf manual and seen the post Configuring nameserver per domain?. the OP seems to want something similar.

Is there a simple method for achieving this? I think split DNS (from the little I understood) is quite the overkill (if its the only way, I will appreciate some sort of guide please).

the OS is Linux Ubuntu 12.04.

share|improve this question
    
I think I can explain how to do this by using a BIND instance running locally, and using 127.0.0.1 in resolv.conf, but this is rather overkill. Are you able to explain which dns-proxy service you're using? As I don't see myself why setting this service up for one domain would also force it to be used for other domains, each domain has its own set of authoritative nameservers so the DNS records can be totally different for each; your question doesn't make sense to me in the way that you've worded it. –  gac May 28 '12 at 14:53
    
Actually, I think I now understand what you mean. The answer below, and setting up BIND as a local, forwarding-only resolver, is the only solution I can think of right now. –  gac May 28 '12 at 14:56
1  
possible duplicate of Is there a way to use a specific DNS for a specific domain? –  mgorven May 28 '12 at 20:16

2 Answers 2

up vote 0 down vote accepted

simple

run the following commands

sudo apt-get install dnsmasq

then edit /etc/dnsmasq.conf (with sudo!)

find the following string in the file

#server=/localnet/192.168.0.1

and add afterwards

server=/your_forward_domain/you_custom_DNS_ip

for all the other domains it will automatically use the same DNS as your system used before.

don't forget to

sudo /etc/init.d/dnsmasq restart
share|improve this answer

You can setup a local DNS resolver.

Then, if you need to use specific resolver for a domain, just forward DNS query to the resolver by setting a forward zone in your bind configuration :

zone "example.com" IN {
    type forward;
    forwarders {10.0.0.1; 10.0.0.2;};
};

zone "example2.com" IN {
    type forward;
    forwarders {10.0.0.3; 10.0.0.4;};
};
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.