LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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
 
LinkBack Search this Thread
Old 08-11-2008, 10:20 PM   #1
metallica1973
Senior Member
 
Registered: Feb 2003
Location: Washington D.C
Posts: 1,966

Rep: Reputation: 55
Bind/Apache/DMZ


I have a web server hosting web pages on my DMZ. My Domain registrar is doing the DNS stuff for the external stuff and I am controlling the DNS stuff locally(caching). My issue that I am having is that my external users can see my web pages perfectly fine but my internal users cannot see my web pages from the inside. I can get to web server via ssh and am not having an issue actually getting to it but rather only Apache and I suspect that it has to due with DNS. My DMZ is on a 192.168.2.0 network. What kind of entry would I need to add my web server. Security is an issue so keep that in mind. Here is my /etc/named.conf

PHP Code:
acl test.com 192.168.3.0127.0/8; };

options {
        
listen-on port 53 127.0.0.1192.168.3.1; };
        
directory       "/var/named";
        
dump-file       "/var/named/data/cache_dump.db";
        
statistics-file "/var/named/data/named_stats.txt";
        
memstatistics-file "/var/named/data/named_mem_stats.txt";
//      query-source    port 53;
//      query-source-v6 port 53;
        
allow-query     127.0.0.1192.168.3.0/27;  };
        
notify no
        
forwarders      4.2.2.54.2.2.6;  };

};
logging {
        
channel default_debug {
                
file "data/named.run";
                
severity dynamic;
        };
};

view "localhost_resolver"
 
{
        
match-clients      localhost192.168.3.0/27; };
        
match-destinations localhost192.168.3.0/27;  };
        
recursion yes;
        include 
"/etc/named.rfc1912.zones";

}; 
Here is my zone file - test.com

PHP Code:

$TTL 1D
;
;       
Anythime you make a change to the domain change the "serial setting below. Here is the format "YYYYMMDDI"
;
test.com.                    IN     SOA     server.test.com. admin.test.com. (

                           200612291 ; serial
                           2H        ; refresh
                           5M        ; retry
                           1W        ; retry
                           1M        ; expire
                        )
 (NS)

@                       IN      NS           server.test.com.




;       Our hostnames in alphabetical order

server.test.com.                              IN  A      192.168.3.1
nameserver                                      IN  CNAME  server2.test.com.
server3.test.com.                              IN  A      192.168.3.5
client1.test.com.                         IN  A      192.168.3.22
client2.test.com.                           IN  A      192.168.3.30 
 
Old 08-11-2008, 10:55 PM   #2
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 57
You essentially have a split DNS, with the slight modification that an external NS controls public name lookups, but your internal NS controls LAN lookups.

You need to create LAN IP entries for each host you want accessible by name. This would be a series of A records, and the equivalent PTR records.

Then, all your clients should be using your internal caching DNS server; give out the address either via DHCP, or manually configure internal clients.

Add your test.com as a zone in your named.conf file, or it won't be seen.

Your serial number looks very old. Updated it with today's date plus and a 2 digit number (eg. 2008081101). Always update the number when you change the zone files.
 
Old 08-11-2008, 11:49 PM   #3
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 69
PHP Code:
view "localhost_resolver" 
 

        
match-clients      localhost192.168.3.0/27; }; 
        
match-destinations localhost192.168.3.0/27;  }; 
        
recursion yes
        include 
"/etc/named.rfc1912.zones";
 
        
zone "test.com" {
            
type master;
            
file "path/to/zonefile";
        };

}; 
 
Old 08-12-2008, 12:41 AM   #4
metallica1973
Senior Member
 
Registered: Feb 2003
Location: Washington D.C
Posts: 1,966

Original Poster
Rep: Reputation: 55
PHP Code:
view "localhost_resolver" 
 

        
match-clients      localhost192.168.3.0/27; }; 
        
match-destinations localhost192.168.3.0/27;  }; 
        
recursion yes
        include 
"/etc/named.rfc1912.zones";
 
        
zone "test.com" {
            
type master;
            
file "path/to/zonefile";
        };

}; 
the DMZ is a 192.168.2.0/27 network so would it look something like this:

PHP Code:
view "localhost_resolver" 
 

        
match-clients      localhost192.168.2.0/27192.168.3.0/27; }; 
        
match-destinations localhost192.168.2.0/27192.168.3.0/27;  }; 
        
recursion yes
        include 
"/etc/named.rfc1912.zones";
 
        
zone "test.com" {
            
type master;
            
file "path/to/zonefile";
        };

}; 
 
Old 08-12-2008, 01:43 AM   #5
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 69
I guess, but really localhost_resolver view is just supposed to be for your loopback adaptor (127.0.0.1). You should use views called "internal" and "external" (or something similar) to specify other networks to match.

PHP Code:
view localhost_resolver {
    
match-clients 127.0.0.1; ::1; };
    ...
}

view internal {
    
match-clients 192.168.2.0/27192.168.3.0/27; };
    ...
};

view external {
    
match-clients { !127.0.0.1; !::1; !192.168.2.0/27; !192.168.3.0/27any; };
    ...
}; 
By the way, why on Earth are you using /27 netmasks? There's no need to conserve internal IPs, why not just use the whole /24?

PS You would put the same code for test.com zone in both localhost_resolver and internal. In external you would deny query and recursion, or just not define an external view at all (since you're not hosting the external records).

Last edited by chort; 08-12-2008 at 01:45 AM.
 
Old 08-12-2008, 10:33 AM   #6
metallica1973
Senior Member
 
Registered: Feb 2003
Location: Washington D.C
Posts: 1,966

Original Poster
Rep: Reputation: 55
I will check into. Many thanks
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
question about iptables (DMZ machine connect to other DMZ machine 's publuic IP) wingmak Linux - Security 1 01-20-2007 04:01 PM
My LAN can't "see" my DMZ server to chk my Apache website piratebiter Linux - Networking 3 05-08-2005 05:19 PM
BIND and Apache trees Linux - Networking 4 07-27-2004 11:12 AM
bind and apache ethanchic Linux From Scratch 2 08-15-2002 01:11 AM
Bind 8 Apache justlinux Linux - Networking 11 07-21-2001 04:38 PM


All times are GMT -5. The time now is 01:05 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
Open Source Consulting | Domain Registration