LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   A question about BIND (https://www.linuxquestions.org/questions/linux-networking-3/a-question-about-bind-337293/)

objorkum 06-26-2005 08:51 AM

A question about BIND
 
I want to use one BIND server to be a DNS server for my internal network and my internet domains.

So for example when an internal client asks for the IP of www.domain.com it gets:

192.168.1.14

But when an internet client asks for the IP of www.domain.co it gets:

217.149.2.4

(Just made some IPs)

How can I do that?

Thanks.

stefan_nicolau 06-26-2005 09:32 AM

Quote:

But when an internet client asks for the IP of www.domain.co it gets:
If you forgot the m in www.domain.co, skip to C)

These are the dns entries that have to be in your bind zone file.
Code:

www.domain.com.  IN      A      192.168.1.14
www.domain.co.    IN      A      217.149.2.4

Here are the catches:
A) You should set www records to be CNAME's, not A's:
Code:

www.domain.com.  IN      CNAME      server1.domain.com
server1.domain.com.    IN      A      217.149.2.4

B) If an internet client requests www.domain.com, it gets 192.168.1.14
C) Maybe you forgot the m in www.domain.co... I guess that means what you want is to set up different client views. http://www.zytrax.com/books/dns/ch7/view.html
Code:

bind.conf/named.conf:

...
view "trusted" {
 match-clients { 192.168.23.0/24; }; // our network
  recursion yes;
  zone "example.com" {
  type master;
  // private zone file including local hosts
  file "internal/master.example.com";
  };
  // add required zones
 };
view "badguys" {
 match-clients {"any"; }; // all others hosts
 // recursion not supported
 recursion no;
 };
 zone "example.com" {
  type master;
  // public only hosts
  file "external/master.example.com";
  };
  // add required zones
 };
...


objorkum 06-26-2005 01:43 PM

Thanks!

Yeah I forgot the m :)


All times are GMT -5. The time now is 09:13 PM.