DEV Community

Fatih ASLAN
Fatih ASLAN

Posted on

3

Ubuntu Üzerine DNS(Named - Bind) Servisinin Kurulum ve Yapılandırması - Public or Private DNS

sudo apt install -y bind9 bind9utils bind9-doc dnsutils
Enter fullscreen mode Exit fullscreen mode

Yapılandırma dosyaları /etc/bind/ altındadır.

Oluşturacağımız forward zone ve reverse zone bu dosya içerisinde belirtiyoruz /etc/bind/named.conf.local

cd /etc/bind
Enter fullscreen mode Exit fullscreen mode
sudo vi named.conf.options
Enter fullscreen mode Exit fullscreen mode

Aşağıdaki yapılandırma satırlarını ortamınıza göre şekillendirebilirsiniz.


        allow-query { any; };
        listen-on port 53 { any; };
        allow-transfer { none; };
        recursion yes;
        querylog yes;
        allow-recursion { any; };
        version "Ubuntu DNS Server for fatlan.com";
        dnssec-validation auto;
        listen-on-v6 { any; };
        forwarders {
            8.8.8.8;
        };

Enter fullscreen mode Exit fullscreen mode
sudo vi named.conf.local
Enter fullscreen mode Exit fullscreen mode
zone "fatlan.com" IN {

     type master;

     file "/etc/bind/fatlan.com";

     allow-update { none; };
};


zone "0.0.127.in-addr.arpa" IN {

     type master;

     file "/etc/bind/reverse.fatlan.com";

     allow-update { none; };
};
Enter fullscreen mode Exit fullscreen mode

Şimdi fatlan.com ve reverse.fatlan.com dosyalarını oluşturalım.

sudo cp db.local  fatlan.com

sudo cp db.127  reverse.fatlan.com
Enter fullscreen mode Exit fullscreen mode
sudo vi fatlan.com
Enter fullscreen mode Exit fullscreen mode

127.0.0.1 no'lu ip'ler yerine sizin için ilgili ip'yi girmeniz önerilir.

;
; BIND data file for local loopback interface
;
$TTL    604800
@       IN      SOA     ns.fatlan.com. root.ns.fatlan.com. (
                              2         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL
;
@       IN      NS      ns.fatlan.com.
@       IN      A       127.0.0.1
@       IN      AAAA    ::1
ns      IN      A       127.0.0.1
Enter fullscreen mode Exit fullscreen mode
sudo vi reverse.fatlan.com
Enter fullscreen mode Exit fullscreen mode

127.0.0.1 no'lu ip'ler yerine sizin için ilgili ip'yi girmeniz önerilir.

;
; BIND reverse data file for local loopback interface
;
$TTL    604800
@       IN      SOA     ns.fatlan.com. root.ns.fatlan.com. (
                              1         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL
;
@       IN      NS      ns.fatlan.com.
NS      IN      A       127.0.0.1
1       IN      PTR     ns.fatlan.com.
Enter fullscreen mode Exit fullscreen mode
sudo named-checkconf
Enter fullscreen mode Exit fullscreen mode
sudo named-checkzone fatlan.com /etc/bind/fatlan.com
Enter fullscreen mode Exit fullscreen mode
sudo named-checkzone reverse.fatlan.com /etc/bind/reverse.fatlan.com
Enter fullscreen mode Exit fullscreen mode

image

sudo systemctl start bind9.service
Enter fullscreen mode Exit fullscreen mode

Şimdi dns server'ımı /etc/resolv.cond dan bu dns gösterip aşağıdaki testleri yapıyorum.

image

ilgili portları tespit için aşağıdaki komutları kullanabilirsiniz.

sudo ss -plnta | egrep -i named

sudo netstat -plnta | egrep -i named
Enter fullscreen mode Exit fullscreen mode

NoT: Her kayıt eklendiğinde mutlaka Serial kısmı arttırılmalıdır.

fatlan.com için örnek kayıtlar...

fatlan.com.   IN     MX   10   mail.fatlan.com.

www     IN       A      127.0.0.1
mail    IN       A      127.0.0.1

ftp     IN      CNAME   www.fatlan.com.
Enter fullscreen mode Exit fullscreen mode

reverse.fatlan.com için örnek kayıtlar...

3     IN      PTR    www.fatlan.com.
4     IN      PTR    mail.fatlan.com.
Enter fullscreen mode Exit fullscreen mode

ref: https://ubuntu.com/server/docs/service-domain-name-service-dns

5 Playwright CLI Flags That Will Transform Your Testing Workflow

  • 0:56 --last-failed
  • 2:34 --only-changed
  • 4:27 --repeat-each
  • 5:15 --forbid-only
  • 5:51 --ui --headed --workers 1

Learn how these powerful command-line options can save you time, strengthen your test suite, and streamline your Playwright testing experience. Click on any timestamp above to jump directly to that section in the tutorial!

Top comments (0)

Image of Timescale

📊 Benchmarking Databases for Real-Time Analytics Applications

Benchmarking Timescale, Clickhouse, Postgres, MySQL, MongoDB, and DuckDB for real-time analytics. Introducing RTABench 🚀

Read full post →

👋 Kindness is contagious

Engage with a wealth of insights in this thoughtful article, valued within the supportive DEV Community. Coders of every background are welcome to join in and add to our collective wisdom.

A sincere "thank you" often brightens someone’s day. Share your gratitude in the comments below!

On DEV, the act of sharing knowledge eases our journey and fortifies our community ties. Found value in this? A quick thank you to the author can make a significant impact.

Okay