LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Trying to Host DNS with Bind, SO close, question (https://www.linuxquestions.org/questions/linux-server-73/trying-to-host-dns-with-bind-so-close-question-4175412070/)

contraversy 06-18-2012 11:12 AM

Trying to Host DNS with Bind, SO close, question
 
Ok, so I want to host my domain mizfitz.org with my computer using BIND. I did this before with FreeBSD and for some reason having trouble getting it to work on CentOS 6. It took forever but I am able to ping my domain (from inside the network and outside the network) but when I visit the webpage from inside the network it pulls up my router's configuration page. And if you try to access it from Outside the network it cant find the webpage.

I simply need some experienced eyes to look this over for me and show me where I am going wrong if you could

Here is all the relevant information I could think to add:


MY IP ADDRESS 68.186.186.44
ROUTER IP ADDR 192.168.2.1
NameServers are at ns3/ns12.zoneedit.com (my ip is dynamic so they act as my nameservers)


Code:

[root@mizfitz etc]# ping -c3 www.mizfitz.org
PING www.mizfitz.org (68.186.186.44) 56(84) bytes of data.
64 bytes from www.mizfitz.org (68.186.186.44): icmp_seq=1 ttl=64 time=0.192 ms
64 bytes from www.mizfitz.org (68.186.186.44): icmp_seq=2 ttl=64 time=0.128 ms
64 bytes from www.mizfitz.org (68.186.186.44): icmp_seq=3 ttl=64 time=0.163 ms

--- www.mizfitz.org ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2000ms
rtt min/avg/max/mdev = 0.128/0.161/0.192/0.026 ms

Code:

[root@mizfitz etc]# dig www.mizfitz.org

; <<>> DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.3 <<>> www.mizfitz.org
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 46623
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;www.mizfitz.org.                IN        A

;; ANSWER SECTION:
www.mizfitz.org.        150        IN        A        68.186.186.44

;; Query time: 0 msec
;; SERVER: 192.168.2.1#53(192.168.2.1)
;; WHEN: Mon Jun 18 10:53:29 2012
;; MSG SIZE  rcvd: 49

Code:

[root@mizfitz etc]# nslookup www.mizfitz.org
Server:                192.168.2.1
Address:        192.168.2.1#53

Non-authoritative answer:
Name:        www.mizfitz.org
Address: 68.186.186.44

/etc/named.conf
Code:

options {
        listen-on port 53 { any; };
        listen-on-v6 port 53 { ::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";
        allow-query    { any; };
        recursion yes;

        dnssec-enable yes;
        dnssec-validation yes;
        dnssec-lookaside auto;

        /* Path to ISC DLV key */
        bindkeys-file "/etc/named.iscdlv.key";
};

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

zone "." IN {
        type hint;
        file "named.ca";
};

#include "/etc/named.rfc1912.zones";
zone "localhost" IN {
        type master;
        file "localhost.zone";
        allow-update { none; };
};

zone "mizfitz.org" {
                type master;
                file "/var/named/mizfitz.org.hosts";
                allow-transfer {
                        127.0.0.1;                      # localhost
                        68.186.186.44;
                        76.74.236.21;
                        209.62.64.46;
                };
                notify yes;
};


zone "2.168.192.in-addr.arpa" {
        type master;
        file "/var/named/2.168.192.in-addr.arpa.rev";

};
include "/etc/named.rfc1912.zones";

/var/named/mizfitz.org.hosts
Code:

$TTL 3600
mizfitz.org.    IN        SOA    ns3.zoneedit.com. admin@mizfitz.org. (
                        2012061802
                        3H
                        1H
                        1W
                        1D )

        ; Name Server
        IN        NS        mizfitz.org.
        IN        NS        ns3.zoneedit.com.
        IN        NS        ns12.zoneedit.com.

        ; Mail Exchanger

mizfitz.org.                    IN A            68.186.186.44
www                    IN CNAME                68.186.186.44

/etc/2.168.192.in-addr.arpa.rev
Code:

@        IN        SOA    ns3.zoneedit.com. mizfitz.org.    (
2007040301        ;serial
14400                ;refresh
3600                  ;retry
604800              ;expire
10800                ;minimum
)

2.168.192.in-addr.arpa.                IN      NS      ns3.zoneedit.com.
2.168.192.in-addr.arpa.                IN      NS      ns12.zoneedit.com.

5              IN        PTR    mizfitz.org.

When I visit in a webbrowser http://192.168.2.5/ my index.html loads fine
When I visit in a webbrowser http://www.mizfitz.org/ i get my router config page

When Outsider visits http://www.mizfitz.org/ just not found
Outsider can ping/dig/nslookup just fine


If you need anymore info let me know



What I think it is, I think it has something to do with either my router (this machine is currently set on the DMZ, but get same results inside router when I simply portforward) or it has to do with my reverse ip settings


Any help will be greatly appreciated!

mago 06-18-2012 04:55 PM

Well a couple of things here.

Have you created a PAT(port address translation) in your router so the HTTP requests are redirected to 192.168.2.5?
And you need to read about BIND Views and NAT(network address translation).

From the outside they are reaching your router that most likely has all ports closed, if open the port and map it to your machine, from the outside they will be able to see it.

Now on your internal network you are providing your public IP, which is indeed the router, hence the need for views.

contraversy 06-18-2012 07:53 PM

thank you

My machine is on the DMZ, a feature that my router provides that sets the server outside of any firewall and port forwarding, so that I do not have to forward ports. Or atleast that is how it worked on FreeBSD.

Also my reverse IP zone file designates my LAN IP (192.168.2.5) in the PTR record.

If that is not what you are referring to please explain, thanks for the response!

contraversy 06-18-2012 08:09 PM

[SOLVED] I guess it was a directory error, did a fresh install of CentOS and copied those files back over, works like a charm


All times are GMT -5. The time now is 05:33 PM.