LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 09-07-2007, 11:34 AM   #1
humbletech99
Member
 
Registered: Jun 2005
Posts: 374

Rep: Reputation: 30
Bind DNS Server - answer a few records for another domain?


I have some Bind DNS Servers which I need to be able to resolve some addresses for anotherdomain.com which are not publicly available from anotherdomain.com's DNS servers.

I still want my DNS servers to forward the rest of the anotherdomain.com requests to the real DNS servers for that domain if I don't have a local record.

I have been going round the internet all day trying to figure this out and testing one dns server with a stub zone, a forward zone etc but so far no luck. All I've learnt is that I don't even know if this can even be done, but I must do it.

The only alternatives to my DNS servers answering a few names and forwarding the rest for anotherdomain.com is

1. Host a full zone for anotherdomain.com (but I don't have all the records so this would cut off my users off from the rest of anotherdomain.com's addresses which I don't have)
2. Go round and add a hosts file to every single dang machine in my company to point to those few resources in anotherdomain that I need which aren't publicly available.


Any ideas how I can solve this problem?
 
Old 09-07-2007, 10:11 PM   #2
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 48
Yes, it is relatively easy to do, but only if what you are looking to hold for yourself are full subdomains. It doesn't matter what those subs are, www, mail, or ahdsjahfsa. As long as it is something before the domain name, it can be done.

In your named.conf, define the specific subdomain in its own zone, for example mail.anotherdomain.com. Then your server will only answer queries from your machines for mail.anotherdomain.com, but would still forward anythingelse.anotherdomain.com to the anotherdomain.com nameservers.

Seriously though, what you are doing is either wrong in the first place or just a bad idea. If the other domain doesn't publicly define these other subdomains, why use them? If you are doing something legal, they could identify your server as a slave for their full zone or atleast these subdomains you are interested in, and you can run as a slave for these subs.

Peace,
JimBass
 
Old 09-09-2007, 12:00 PM   #3
humbletech99
Member
 
Registered: Jun 2005
Posts: 374

Original Poster
Rep: Reputation: 30
Thanks for that.

You mean I have to define a whole zone for each host.anotherdomain.com?

and leave the zone as the only record for hostaszone.anotherdomain.com?

Reason for this: basically we have been bought by a bigger company and they have granted us access to an intranet and one or two other sites. There are no public dns records because they are internal services that we are using through a limited vpn. The paths on the websites are hard coded so we must have those resolve one way or the other.
 
Old 09-09-2007, 03:52 PM   #4
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 48
It has to do with your ability to define the default company.com, and the ability to pass requests for the other names on the the main company default nameserver. If you didn't define site1.company.com and site2.company.com explicitly, but rather simply did company.com, then any request to your DNS server wouldn't get passed on to the company.com DNS.

You could get them to email you their full zone, and then install that as company.com on your machine. That might be the most elegant and simple way to do this.

Otherwise, yes, you will have to define each subdomain explicitly on your named.conf.

Peace,
JimBass
 
Old 09-09-2007, 04:44 PM   #5
humbletech99
Member
 
Registered: Jun 2005
Posts: 374

Original Poster
Rep: Reputation: 30
Ok thanks, I'll try that tomorrow when back at work.

Appreciate the help.
 
Old 09-09-2007, 06:06 PM   #6
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 48
No problem. Write back if something doesn't work.

Peace,
JimBass
 
Old 09-10-2007, 06:17 AM   #7
humbletech99
Member
 
Registered: Jun 2005
Posts: 374

Original Poster
Rep: Reputation: 30
thanks, that seems to work really well.
 
Old 06-16-2010, 08:26 AM   #8
GiladGruber
LQ Newbie
 
Registered: Jun 2010
Posts: 5

Rep: Reputation: 0
More info please

I need to do a similar thing. would like to handle just one sub-domain of a foreign domain. In the named.conf I added a section with the subdomain I would like to handle and indeed all other subdomain of the foreign domain are not handled by me. I have a problem with the subdomain I am trying to handle. Can you please post a zone file that handles this

Many Thanks,

G
 
Old 06-16-2010, 08:41 AM   #9
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 48
I you have the subdomain defined in your named.conf (or named.conf.local, or whatever your distro uses for listing the zones), then all you need to do is create the subdomain zone file. There is nothing special about that file at all. The same way you can do "yoursite.org" in named.conf and have a yoursite.org where your zone files live, you can just as easily have yoursub.theirdomain.com and yoursub.theirdomain.com with the zone files. Try using the tools named-checkconf and named-checkzone on your config and zone files.
 
Old 06-16-2010, 10:18 AM   #10
GiladGruber
LQ Newbie
 
Registered: Jun 2010
Posts: 5

Rep: Reputation: 0
Thanks,

I have it almost working with one issue that seems to be a show stopper. I want to act as a proxy for a subdomain, so I want the request to get to me and then I want to redirect it to another server using a CNAME record, cant use an A record as the IP address of where I would like to redirect keep changing (Amazon ELB). And when I use a a CNAME named-checkzone complains about the CNAME

NR,

G
 
Old 06-16-2010, 01:02 PM   #11
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 48
This sounds like a very bad idea, or at least a poorly planned one.

To begin with, CNAME records are not a problem, if named-checkzone is complaining about it, then you must have done something wrong with the setup. I (and most BIND users) have CNAME records in plenty of zones, and named-checkzone doesn't report any problems with them.

Secondly, if you're going to allow the zone to be resolved by its authoritative DNS server, why are you interrupting that process to proxy it? I've had business ask me to "break" DNS for them, and I've done that, but broken is broken. What I mean by that is if a business doesn't want their users going to any myspace pages on the company network, You can define the zone *myspace.com and direct it to an internal address (preferably a page that says, "Company X doesn't allow you to visit myspace from your work machine"), but I can't see why you'd get in the middle of resolving an address by an authoritative nameserver that your going to forward to that nameserver anyway?

Please explain specifically what you're trying to do, why you're trying to proxy a DNS request (do you understand how a name server caches names), and print the actual named-checkzone output if that is where the issue lies.

Peace,
JimBass
 
Old 06-17-2010, 04:18 AM   #12
GiladGruber
LQ Newbie
 
Registered: Jun 2010
Posts: 5

Rep: Reputation: 0
Hi Jim,

I need to do a slight twist on your *myspace blocking. I need to get the request, inspect it and allow (based on content) some of the requests to pass on their way.

BR,

G
 
Old 06-18-2010, 08:24 AM   #13
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 48
Then you don't need my *myspace blocking, that blocks every address that ends in myspace.com.

First and foremost, DNS is not the place to do website blocking. That is something that should be left to a content filter/proxy/firewall.

Second, All that is in a DNS query is what the client asked for, and in the reply is the address it should be sent to. In light of that, if for some reason you wanted to allow your LAN to see google.com, www.google.com, maps.google.com, and for some reason block mail.google.com, that can be done in the way I described above. If you have subdomains that are allowed and subdomains that aren't, there's no magic there. You create zones for the subdomains that aren't allowed, and send them elsewhere. That also works well for the next thing that google adds. Suppose in 2 months google puts up a service at new.google.com. In my solution, people can access it easily. If you decide new.google.com is bad, you define a fake zone for it, and it is stopped. Of course this can break badly. The days of a website being static content on just one page are dead and buried. What happens if a page includes some content from an allowed subdomain, and some from one that isn't? Not being able to load certain pictures might be just what you're after, but what if the allowed functions depend on the ones that aren't allowed? That is a dangerous path that I would avoid at all costs.

Third, I've asked several times what you're trying to accomplish, and you're speaking in generalities. I am willing to help you, but I have no interest in donating my time and effort when you can't even tell me straight what you're trying to do. I've told you multiple times what you're trying to do doesn't sound right, and you dismiss my criticism. That's your right, but its also my right to not share knowledge with you that I feel will be used badly.

Peace,
JimBass
 
Old 06-20-2010, 01:40 AM   #14
GiladGruber
LQ Newbie
 
Registered: Jun 2010
Posts: 5

Rep: Reputation: 0
Hi Jim,

Peace dude and apologies, no ill intentions just a new venture I am part off that I am wary of putting on such a public forum. Would it be possible to provide more info on a slightly more private channel?
I am at gilad dot gruber at gmail dot com

BR,

Gilad
 
Old 06-20-2010, 10:46 AM   #15
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 48
If the help you need has to happen off a public forum, then I'm not interested in doing it.

You dug up a 3 year old dead thread because it had info similar to what you were looking for. Imagine the next person in your shoes. They see their problem potentially solved, but instead of having the answer here where it belongs, it would be solved in a location that isn't accessible to them. That undermines this website's credibility, and I don't want to do that.

I'm not saying we'd need to see all the DNS records involved with their real names (though that is the best way to solve DNS problems, the BIND email list will only help if the real domain name is used), but you could easily use example.yoursite.com and yoursub.theirsite.com and such.

If you need it solved privately and fast, there are tons of BIND consultants who will gladly accept money to solve this for you.

Peace,
JimBass
 
  


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
DNS - Deleting Cached Records (Bind 9) zok Linux - Networking 2 12-08-2006 04:39 PM
DNS - Bind 9 on SUSE 9 loses zone records on startup dula Linux - Server 1 12-03-2006 10:15 PM
DNS A records BIND SUSE 10 metallica1973 Linux - Networking 6 09-18-2006 03:28 PM
Traceroute, Ping, Domain Name Server (DNS) Lookup, WHOIS, and DNS Records Lookup netoknet General 1 05-09-2005 03:43 AM
adding win 2000 server domain controller, bind dns GraemeK Linux - Networking 6 08-23-2003 05:44 PM


All times are GMT -5. The time now is 06:59 AM.

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