Product SiteDocumentation Site

10.7. مخدمات أسماء النطاقات Domain Name Servers ‏(DNS)

The Domain Name Service (DNS) is a fundamental component of the Internet: it maps host names to IP addresses (and vice-versa), which allows the use of www.debian.org instead of 130.89.148.77 or 2001:67c:2564:a119::77.
تصنف سجلات DNS في مناطق – zones؛ كل منطقة تقابل نطاقاً (أو نطاقاً فرعياً) أو مجالاً من عناوين IP (بما أن عناوين IP عموماً تحجز بشكل مجالات متسلسلة). يتحكم المخدم الأساسي بمحتويات المنطقة؛ أما المخدمات الفرعية، التي تعمل عادة على أجهزة منفصلة، توفر نسخاً تُحدّث بانتظام عن المنطقة الأساسية.
Each zone can contain records of various kinds (Resource Records), these are some of the most common:

10.7.1. DNS software

The reference name server, Bind, was developed and is maintained by ISC (the Internet Software Consortium). It is provided in Debian by the bind9 package. Version 9 brings two major changes compared to previous versions. First, the DNS server can now run under an unprivileged user, so that a security vulnerability in the server does not grant root privileges to the attacker (as was seen repeatedly with versions 8.x).
بالإضافة لذلك، أصبح Bind يدعم معيار DNSSEC لتوقيع سجلات DNS (ومصادقتها أيضاً)، وهذا يسمح بمنع تزوير (spoofing) هذه البيانات عبر هجمات man-in-the-middle.

10.7.2. Configuring bind

مهما كان إصدار bind، فإن ملفات إعداده لها البنية نفسها.
أنشأ مديرو النظم في شركة فلكوت منطقة أساسية falcot.com لتخزين المعلومات المتعلقة بهذا النطاق، ومنطقة 168.192.in-addr.arpa للمقابلة العكسية (reverse mapping) لعناوين IP في الشبكات المحلية.
يمكن أن تساعد المقتطفات التالية، المأخوذة من ملفات شركة فلكوت، على ضبط مخدم DNS:

مثال 10.12. مقتطفات من /etc/bind/named.conf.local

zone "falcot.com" {
        type master;
        file "/etc/bind/db.falcot.com";
        allow-query { any; };
        allow-transfer {
                195.20.105.149/32 ; // ns0.xname.org
                193.23.158.13/32 ; // ns1.xname.org
        };
};

zone "internal.falcot.com" {
        type master;
        file "/etc/bind/db.internal.falcot.com";
        allow-query { 192.168.0.0/16; };
};

zone "168.192.in-addr.arpa" {
        type master;
        file "/etc/bind/db.192.168";
        allow-query { 192.168.0.0/16; };
};

مثال 10.13. مقتطفات من /etc/bind/db.falcot.com

; falcot.com Zone 
; admin.falcot.com. => zone contact: admin@falcot.com
$TTL    604800
@       IN      SOA     falcot.com. admin.falcot.com. (
                        20040121        ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL
;
; The @ refers to the zone name ("falcot.com" here)
; or to $ORIGIN if that directive has been used
;
@       IN      NS      ns
@       IN      NS      ns0.xname.org.

internal IN      NS      192.168.0.2

@       IN      A       212.94.201.10
@       IN      MX      5 mail
@       IN      MX      10 mail2

ns      IN      A       212.94.201.10
mail    IN      A       212.94.201.10
mail2   IN      A       212.94.201.11
www     IN      A       212.94.201.11

dns     IN      CNAME   ns

مثال 10.14. مقتطفات من /etc/bind/db.192.168

; Reverse zone for 192.168.0.0/16
; admin.falcot.com. => zone contact: admin@falcot.com
$TTL    604800
@       IN      SOA     ns.internal.falcot.com. admin.falcot.com. (
                        20040121        ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL

        IN      NS      ns.internal.falcot.com.

; 192.168.0.1 -> arrakis
1.0     IN      PTR     arrakis.internal.falcot.com.
; 192.168.0.2 -> neptune
2.0     IN      PTR     neptune.internal.falcot.com.

; 192.168.3.1 -> pau
1.3     IN      PTR     pau.internal.falcot.com.