LinuxQuestions.org
Visit Jeremy's Blog.
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 09-21-2011, 08:35 AM   #1
benjalien
Member
 
Registered: Aug 2003
Location: Belgium
Distribution: Debian (i686/ppc/amd64)
Posts: 85

Rep: Reputation: 15
Question Call DNS server based on domain query


Hi everyone,

I have a strange setup here and I need to do some tweaking to get it solved.

I'm on a network where all DNS queries to Dynamic IPs (dyndns.com) are redirected to a "don't go there" IP.

So I tought about setting a static external DNS server IP in my resolv.conf using /etc/dhcp/dhclient.conf.

This works fine!

The only problem I have now, is that if I put the external DNS server first, I don't have any name resolution for the internal network, and if I put the internal DNS first, I don't have any name resolution for the dyndns domains...

How can I configure my linux to tell it to go to the internal DNS for .internal.org adresses, and to the external for everything else?

Quite interesting, insn't it?

Benja
 
Old 09-21-2011, 10:03 AM   #2
jason_not
Member
 
Registered: Aug 2010
Location: Beaverton, Oregon, USA
Distribution: Pfsense, Ubuntu, Centos, Fedora, Redhat, Scientfic, MacOS
Posts: 76

Rep: Reputation: 19
Hi.

My first thought is "why are resolutions go dyndns.org being re-directed?" If that's just your ISP, then ensure you are not breaking some sort of acceptable use policy. However, if this is where you work, bypassing your IT department's policies could be bad for you.

Having said that, when I need a more complex dns solution such as your own, I build my own dns server locally. You can then change teh settings in resolv.conf to "nameserver 127.0.0.1". You can configure zones, so that queries to internal domains get re-directed to the internal dns servers, whereas all others can get routed to the internet dns server of your choice.

I will not try to tell you how to configure a dns server: that is WAY beyond this topic.

I hope this helps...

--jason
 
Old 09-25-2011, 04:55 PM   #3
barlafues
LQ Newbie
 
Registered: Sep 2011
Posts: 3

Rep: Reputation: Disabled
Quote:
Originally Posted by benjalien View Post
The only problem I have now, is that if I put the external DNS server first, I don't have any name resolution for the internal network, and if I put the internal DNS first, I don't have any name resolution for the dyndns domains...

How can I configure my linux to tell it to go to the internal DNS for .internal.org adresses, and to the external for everything else?
You can make the external DNS a cache. You can then tell the cache to direct queries for *.dyndns.com to a phony server, queries for *.yourcompany.com to the internal DNS, and all other queries to root nameservers. Dnscache from djbdns allows you to do this quite simply.
 
Old 09-26-2011, 06:13 AM   #4
benjalien
Member
 
Registered: Aug 2003
Location: Belgium
Distribution: Debian (i686/ppc/amd64)
Posts: 85

Original Poster
Rep: Reputation: 15
Hi Jason_not and barlafues,

I was looking for some sort of "easy solution" to avoid having to play in my resolv.conf during the day. Setting up a local DNS server or starting to cache stuff is too complicated for the additional comfort it would bring... But anyway, thanks for your replies!
 
  


Reply

Tags
beer, block, dns, dyndns, firewall


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
Redirect local DNS query to remote DNS server on non standard port? rock_ya_baby Linux - Server 8 04-13-2010 04:31 AM
Choosing DNS server based on domain being queried xtc Linux - Networking 3 10-01-2009 10:21 AM
Web based reverse DNS query tools? elfoozo Linux - Networking 2 02-16-2007 06:21 PM
Help needed regarding DNS server query myself_rajat Linux - Networking 8 08-16-2004 06:09 AM


All times are GMT -5. The time now is 03:11 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration