Setting up a DNS Server | Bind9 & Docker

Поділитися
Вставка
  • Опубліковано 15 вер 2024
  • Linux Server Video #4
    #Linux_Server #SnatchDreams #docker #bind9 #Ubuntu #dns #linux #server
    This video demonstrates how to setup your own DNS server using Docker and Bind9. ! Hope you find this video useful.
    Want to know how to create a simple Apache Web Server : PHP MySQL on Linux ?
    • Apache Web Server On L...
    Want to know how to host Multiple websites using Apache2 Virtual Host ?
    • Apache 2 : Host Multip...
    Buy me a coffee:
    imjo.in/bSQUvk
    www.paypal.me/...
    Hope You guys enjoyed this video!
    Thank you all for your great support !!
    Dont forget to subscribe
    Like us on : / snatchdreams
    Visit us on : www.snatchdream...
    SnatchDreams !!!
    Config Files for Bind9
    -----------------------------------
    paulpjoby@ubuntu-wag-server:~$ cat bind9-dns-docker/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 www.kb.cert.org...
    // 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 {
    8.8.8.8;
    9.9.9.9;
    };
    //========================================================================
    // If BIND logs error messages about the root key being expired,
    // you will need to update your keys. See www.isc.org/bi...
    //========================================================================
    dnssec-validation auto;
    listen-on-v6 { any; };
    };
    paulpjoby@ubuntu-wag-server:~$ cat bind9-dns-docker/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 "paulpjoby.com" {
    type master;
    file "/etc/bind/forward.paulpjoby.com";
    };
    zone "1.168.192.in-addr-arpa" {
    type master;
    file "/etc/bind/reverse.paulpjoby.com";
    };
    paulpjoby@ubuntu-wag-server:~$
    Forward Zone File
    ;
    ; BIND data file for local loopback interface
    ;
    $TTL 20
    @ IN SOA paulpjoby.com. root.paulpjoby.com. (
    2 ; Serial
    20 ; Refresh
    20 ; Retry
    20 ; Expire
    20 ) ; Negative Cache TTL
    ;
    @ IN NS paulpjoby.com.
    @ IN A 192.168.1.100
    www IN A 192.168.1.100
    @ IN AAAA 1234:1234::1
    paulpjoby@ubuntu-wag-server:~$
    paulpjoby@ubuntu-wag-server:~$ cat bind9-dns-docker/reverse.paulpjoby.com
    ;
    ; BIND reverse data file for local loopback interface
    ;
    $TTL 20
    @ IN SOA paulpjoby.com. root.paulpjoby.com (
    1 ; Serial
    20 ; Refresh
    20 ; Retry
    20 ; Expire
    20 ) ; Negative Cache TTL
    ;
    @ IN NS paulpjoby.com.
    100 IN PTR paulpjoby.com.
    paulpjoby@ubuntu-wag-server:~

КОМЕНТАРІ • 11

  • @wesleypitcock3892
    @wesleypitcock3892 Рік тому +8

    surprising how little content is out there for basic ubuntu/bind9 setup. your video helped significantly. thank you :)

    • @SnatchDreams
      @SnatchDreams  Рік тому +1

      Am happy u found it helpful..

    • @wesleypitcock3892
      @wesleypitcock3892 Рік тому +1

      @@SnatchDreams im using centos 7x64 docker. adding this in hopes it helps anyone. add firewalld service dns if your dns host is remote from the instance you are trying to receive dns from.

  • @daniloleal6566
    @daniloleal6566 Рік тому +4

    It's a nice material, but it needs some small fixes.... reverse zone should be changed from "1.168.192.in-addr-arpa" to "1.168.192.in-addr.arpa" in the named.conf.local file otherwise reverse queries will fail. Another thing is to reference the dns server fqdn + domain in the reverse zone file otherwise the zone loading will fail. Cheers.

    • @SnatchDreams
      @SnatchDreams  8 місяців тому +1

      Thanks for pointing it out.

  • @RajeshPatil-kn7ur
    @RajeshPatil-kn7ur Рік тому +3

    How to configure same on Windows 10 machine ??
    Following same steps not working on windows 10.

    • @SnatchDreams
      @SnatchDreams  8 місяців тому

      Either enable WSL (Windows Subsystem Linux) for installing bind9 on Windows or you could try using www.winbind.org/installing-bind-on-windows/

  • @Yashuu96
    @Yashuu96 Рік тому +2

    Good one brother! It would be great if you could share the configurations in a github repo next time rather than YT description.

    • @SnatchDreams
      @SnatchDreams  Рік тому +2

      Yes bro... Will do that, was actually thinking about doing that. I will put these configs in gist.

  • @brezagay6622
    @brezagay6622 8 місяців тому +1

    I have a question that comes to mind
    We assume that we have 5 records, all of them with the same domain name, and each record has a different IP
    Why when requesting query
    The Name Serverin Response brings me all five records, not one or two
    Is this constant in dns consept( i mean all dns softwares works in this way or not)?
    Or there something that can control this? I mean two records only go not the five

    • @SnatchDreams
      @SnatchDreams  8 місяців тому +1

      Hi bro, I might be wrong but to my knowledge there is no theoretical limit for the maximum number of A records or IPv4 addresses that can be associated with a domain name.... But in practice the DNS uses UDP at the transport layer (Layer 4) there is a limit for DNS payload size of 512 bytes when using DNS over UDP. To prevent fragmentation of IP packets.
      Now about limiting the number of records to be returned when queried. Like you mentioned returning a subset of records rather than returning all the records associated with a given domain is possible with certain DNS servers (like PowerDNS so I read somewhere) but can NOT be achieved directly on bind9 DNS server or on dnsmasq DNS server.
      Usually, we return all the records for a given query and it's up to the client to pick which one to choose and all that DNS server does is re-ordering the DNS records when we are queried multiple time. For example, let us say we have 4 A-Records associated with a domain abc.com and let's call it R1, R2, R3 and R4.
      Now when,
      Client 1 queries the response will have all the records like
      Response to client 1: -> R1, R2, R3, R4
      Client 2 queries the response will have all the records like (but in different order)
      Response to client 2: -> R2, R3, R4, R1 (Rotated in a round-robin fashion)
      But normally we respond back with all the DNS records rather than with a subset of records.