Author Topic: DNS Setup  (Read 1198 times)

0 Members and 1 Guest are viewing this topic.

Offline @rjun

  • Serf
  • *
  • Posts: 39
  • Cookies: -10
    • View Profile
DNS Setup
« on: June 18, 2015, 09:27:19 pm »
Hey guys! ;D :o

I recently wanted to have a local DNS server for my family and friends, to share data easily.
But somewhere i'm stuck. Here's my "dig me.cloud":
; <<>> DiG 9.9.5-3ubuntu0.2-Ubuntu <<>> www.me.cloud
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 12011
;; flags: qr rd ad; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1
;; WARNING: recursion requested but not available

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;www.me.cloud.            IN    A

;; Query time: 51 msec
;; SERVER: 192.168.1.1#53(192.168.1.1)
;; WHEN: Fri Jun 19 00:47:02 IST 2015
;; MSG SIZE  rcvd: 41


I'm using Bind9 for DNS.
Configuration is as follows:

1. named.conf.local:

//
// Do any local configuration here
//

// Consider adding the 1918 zones here, if they are not used in your
// organization
//include "/etc/bind/zones.rfc1918";

zone "me.cloud" IN{
        type master;
        file"/etc/bind/zones/me.cloud.db";
};

zone "99.1.168.192.in-addr.arpa"{
        type master;
        file "/etc/bind/zones/99.1.168.192.in-addr.arpa";
};





2. named.conf.options:

options {
    directory "/var/cache/bind";

    // If there is a firewall between you and nameservers you want
    // to talk to, you may need to fix the firewall to allow multiple
    // ports to talk.  See http://www.kb.cert.org/vuls/id/800113

    // If your ISP provided one or more IP addresses for stable
    // nameservers, you probably want to use them as forwarders. 
    // Uncomment the following block, and insert the addresses replacing
    // the all-0's placeholder.

    forwarders {
         192.168.1.1;
        0.0.0.0;
        8.8.8.8;
       
     };

    //========================================================================
    // If BIND logs error messages about the root key being expired,
    // you will need to update your keys.  See https://www.isc.org/bind-keys
    //========================================================================
    dnssec-validation auto;

    auth-nxdomain no;    # conform to RFC1035
    listen-on-v6 { any; };
};



3. zone/99.1.168.192.in-addr.arpa:

;
; BIND reverse data file for local loopback interface
;
$TTL 635356
@    SOA    me.cloud. me.cloud. (
                  1        ; Serial
             604800        ; Refresh
              86400        ; Retry
            2419200        ; Expire
             604800 )    ; Negative Cache TTL
;
99.1.168.192.in-addr.arpa.                IN      NS      ns1.me.cloud.

99    IN    PTR    www.me.cloud.



4. zone/me.cloud.db:

;
; BIND reverse data file for local loopback interface
;
$TTL 635356
@    SOA    me.cloud. me.cloud. (
                  1        ; Serial
             604800        ; Refresh
              86400        ; Retry
            2419200        ; Expire
             604800 )    ; Negative Cache TTL
;
ns1        IN    NS    192.168.1.99
www        IN    A    192.168.1.99
localhost    IN    A    127.0.0.1





____________________________________________________________________________________________::>

I have also setup primary DNS server on my router as 192.168.1.99(www.me.cloud as well as ns1.me.cloud)
Also my /etc/resolv.conf is as follows:
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf( 8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 192.168.1.1



Any guidance would be really helpful.
Thanks  ;D :)
« Last Edit: June 19, 2015, 08:03:03 pm by @rjun »

Offline @rjun

  • Serf
  • *
  • Posts: 39
  • Cookies: -10
    • View Profile
Re: DNS Setup
« Reply #1 on: June 19, 2015, 08:20:33 am »
During my wireshark analysis DNS queries were being sent from 192.168.1.99(my machine) to 192.168.1.1(my router).
The 'Question' parameter was being sent as i saw in wireshark but 'Answer' parameter was empty.
So somehow i believe that either the problem is within my configuration of BIND or with my router. But i have already set my primary DNS server to this machine(192.168.1.99) and secondary DNS server to 8.8.8.8(google's). So narrowing down, i think problem is with above configuration.

Problem: Zones haven't been set yet. (see DIG output above) :)

Offline @rjun

  • Serf
  • *
  • Posts: 39
  • Cookies: -10
    • View Profile
Re: DNS Setup
« Reply #2 on: June 19, 2015, 08:02:00 pm »
Okay. :D
Can you check the configuration only so that i can then shift to my router, because it's kind of mess right now. If i change one thing i have to go back to very beginning and then i am unable to setup DNS then i have to reset every thing and start again.

So if you like kindly check the above posted configuration and warn me if there is something wrong. :)
Once i'm sure that my configuration is right then i can concentrate on other things in a better manner.

What i'm trying to achieve is a local webserver, local DNS server, all on a single machine with IP(192.168.1.99--it's static).
This address should be named as "www.me.cloud".

Thanks Anyway.



EDIT: changed 1.99.168.192.in-addr.arpa to 99.1.168.192.in-addr.arpa.