لینوکس و شبکه

لینوکس و شبکه
طبقه بندی موضوعی
آخرین مطالب
  • ۹۹/۱۱/۱۳
    java

۲ مطلب با کلمه‌ی کلیدی «Domain Name Service» ثبت شده است

۰۱
دی

در آموزش زیر :
    آدرس شبکه :10.0.20.0/24
    نام دامنه: MyDomain.it
    سرور دی ان اس: 10.0.20.240
    سرورد دی ان اس برای فوروارد:192.168.100.12

$ sudo apt install bind9 bind9utils dnsutils resolvconf

$ sudo vim /etc/bind/named.conf.options

​​options {
    directory "/var/cache/bind";
    listen-on port 53 {localhost;10.0.20.0/24;192.168.40.0/24; };
    allow-query {localhost;10.0.20.0/24;192.168.40.0/24;};
    recursion yes;
    forwarders {
        192.168.100.12;
        8.8.8.8;
    };
    dnssec-validation auto;
    auth-nxdomain no;    # conform to RFC1035
    listen-on-v6 { any; };
};

$ sudo vim /etc/bind/named.conf.local

    zone "MyDomain.it" IN {
        type master;
        file "MyDomain.it";
    };

$ vim /var/cache/bind/domain.ir

    $TTL 86400
@    IN    SOA             ns1.MyDomain.it. root.MyDomain.it(
        20191214           ;Serial
        3600               ;Refresh
        900                ;Retry
        604800             ;Expired
        86400              ;Minimum TTL
)

;name servers: NS records
    IN    NS       ns1.MyDomain.it.
    IN    A        192.168.40.40
    IN    MX 10    mail.MyDomain.it.

;name servers: A records
ns1.MyDomain.it.         IN    A    192.168.40.40
dns.MyDomain.it.         IN    A    192.168.40.40
root.MyDomain.it.        IN    A    192.168.40.40
MyDomain.it.             IN    A    192.168.40.40
chat.MyDomain.it.        IN    A    192.168.40.41
mail.MyDomain.it.        IN    A    192.168.40.42
email.MyDomain.it.       IN    A    192.168.40.42
pop3.MyDomain.it.        IN    A    192.168.40.42
smtp.MyDomain.it.        IN    A    192.168.40.42
imap.MyDomain.it.        IN    A    192.168.40.42
behrooz.MyDomain.it.     IN    A    192.168.40.48
  • لاگ افتادن تمام کوئری‌هایی که به سرور DNS زده می‌شود(دستور زیر را در سرور وارد نمایید):
# rndc querylog on
  • دستور زیر برای چک شدن named.conf و موارد included های آن است
$ sudo named-checkconf
  • دستور زیر برای چک شدن زون‌ها می‌باشد
# /usr/sbin/named-checkzone my.net /var/cache/bind/my.net.zone
  • در systemctl سرویس را در حالت اجرای اتوماتیک بعد از ریست قرار میدهیم
$ sudo systemctl enable bind9
$ sudo systemctl start  bind9
  • نکته: برای استفاده از فایل /etc/resolv.conf باید برنامه resolvconf نصب شده باشد

  URL

  URL

  • behrooz mohamadi nsasab
۲۳
ارديبهشت

Resolve:

systemd-resolve -t MX gmail.com   #show mail server

systemd-resolve -t SOA gmail.com   #show SOA .     Start Of Authority (More administrative information)   URL

systemd-resolve 85.214.157.7        #Get domain name

nslookup domain.ir [#Finding The IP Address of an Host from default dns server]

nslookup domain.ir 8.8.8.8[#Finding The IP Address of an Host From non default dns server]

nslookup -querytype=mx domain.ir[ #Find Mail Servers for a Domain]

nslookup -query=mx domain.ir [#Find Mail Servers]

nslookup -query=ns domain.ir [ #Find NameServers]

nslookup -query=soa domain.ir [ #display the SOA record (information about the domain]

nslookup -query=any domain.ir [ #display all the available DNS records]

host -la domain.com [Show all record with Information]

dig Domain.it axfr [Show all record with Information]

systemd-resolve --statistics          #informations

 

Flush the DNS Cache   URL

Method 1: Using systemd-resolve to flush DNS-Cache

sudo systemd-resolve --flush-caches

sudo systemd-resolve --statistics

 

Method 2: Using dns-clean to flush DNS-Cache

sudo /etc/init.d/dns-clean start

 

 

Resolve.conf

Install:

sudo apt install resolvconf

For fix and NotChange file:

vim  /etc/NetworkManager/NetworkManager.conf

#Add below to main area :

dns=none

 

  • behrooz mohamadi nsasab