DNS (Nameserver)

مقدمه

DNS (Domain Name System) سیستمی برای ترجمه نام‌های قابل خواندن توسط انسان (مانند www.example.com) به آدرس‌های آی‌پی است. روتر سودار قابلیت پیکربندی DNS را با امکانات پیشرفته از جمله پشتیبانی از VRF ارائه می‌دهد.

قابلیت‌های DNS در سودار

  • DNS Client: استفاده از سرورهای DNS خارجی برای حل نام

  • DNS Relay: عمل به عنوان سرور DNS برای کلاینت‌ها

  • پشتیبانی کامل VRF: تنظیمات DNS جداگانه برای هر VRF

  • Local Hostnames: تعریف نام‌های محلی برای دستگاه‌ها

  • Reference VRF: استفاده از DNS یک VRF در VRF های دیگر

  • یکپارچگی با DHCP: دریافت خودکار سرورهای DNS از DHCP

کاربردها

  • ✅ حل نام دامنه‌ها در دستورات روتر

  • ✅ ارائه سرویس DNS به شبکه داخلی

  • ✅ مدیریت متمرکز DNS برای چندین VRF

  • ✅ تعریف نام‌های محلی برای دستگاه‌های داخلی

  • ✅ جداسازی ترافیک DNS بین بخش‌های مختلف شبکه

مفاهیم کلیدی

DNS Client

روتر به عنوان کلاینت DNS عمل کرده و از سرورهای DNS پیکربندی شده برای حل نام استفاده می‌کند.

DNS Relay

روتر درخواست‌های DNS کلاینت‌ها را دریافت و به سرورهای DNS ارسال می‌کند، سپس پاسخ را به کلاینت برمی‌گرداند.

VRF-Aware DNS

هر VRF می‌تواند سرورهای DNS و hostname های جداگانه داشته باشد.

Reference VRF

یک VRF می‌تواند از تنظیمات DNS یک VRF دیگر (VRF مرجع) برای حل نام استفاده کند.

دستورات پایه

تنظیم سرور DNS

برای VRF پیش‌فرض:

n1# config terminal
n1/config# ip name-server <DNS-SERVER-IP>

برای VRF خاص:

n1# config terminal
n1/config# ip name-server vrf <VRF-NAME> <DNS-SERVER-IP>

مثال:

n1# config terminal
n1/config# ip name-server 8.8.8.8
n1/config# ip name-server 1.1.1.1
n1/config# ip name-server vrf red 4.2.2.4
n1/config# exit
n1# write

فعال‌سازی DNS Relay

برای VRF پیش‌فرض:

n1# config terminal
n1/config# ip name-server 0.0.0.0

برای VRF خاص:

n1# config terminal
n1/config# ip name-server vrf <VRF-NAME> 0.0.0.0

تعریف Hostname محلی

برای VRF پیش‌فرض:

n1# config terminal
n1/config# ip host <HOSTNAME> <IP-ADDRESS>

برای VRF خاص:

n1# config terminal
n1/config# ip host vrf <VRF-NAME> <HOSTNAME> <IP-ADDRESS>

مثال:

n1# config terminal
n1/config# ip host server1 192.168.1.10
n1/config# ip host www.local.com 10.10.10.100
n1/config# ip host vrf red fileserver 172.16.1.50
n1/config# exit
n1# write

تنظیم Reference VRF

تعیین VRF مرجع:

n1# config terminal
n1/config# ip domain-lookup vrf-reference <VRF-NAME>

استفاده از VRF مرجع در یک VRF:

n1# config terminal
n1/config# ip vrf <VRF-NAME>
n1/config-vrf# ip domain-lookup vrf-reference

استفاده از VRF خاص برای lookup:

n1# config terminal
n1/config# ip vrf <VRF-NAME>
n1/config-vrf# ip domain-lookup vrf <TARGET-VRF>

دستورات نمایش و تست

نمایش تنظیمات DNS

n1# show ip name-server

خروجی نمونه:

Reference VRF for lookups: default
VRF Settings:
  VRF: default
    Name Servers:
      - 8.8.8.8
      - 1.1.1.1
    Nameservers Source: Manual CLI
    DNS Relay Enabled: yes
  VRF: red
    Name Servers:
      - 4.2.2.4
    Nameservers Source: Manual CLI
    DNS Relay Enabled: no
    Upstream Lookup VRF: default

نمایش Hostname ها

n1# show ip host

خروجی نمونه:

VRF Settings:
  VRF: default
    Hostnames:
      - server1: 192.168.1.10
      - www.local.com: 10.10.10.100
  VRF: red
    Hostnames:
      - fileserver: 172.16.1.50

تست حل نام

در VRF پیش‌فرض:

n1# test ip name-server <HOSTNAME>

در VRF خاص:

n1# test ip name-server <HOSTNAME> <VRF-NAME>

مثال:

n1# test ip name-server google.com
Resolved google.com as 142.250.185.78

n1# test ip name-server server1
Resolved server1 as 192.168.1.10

n1# test ip name-server fileserver red
Resolved fileserver as 172.16.1.50

سناریو ۱: DNS Client ساده

توپولوژی

Internet (DNS: 8.8.8.8)
    |
    | ge0: 203.0.113.1/24
  [Soodar]
    | ge1: 192.168.1.1/24
    |
  Clients

هدف

پیکربندی روتر به عنوان DNS client برای حل نام دامنه‌ها.

پیکربندی

n1# config terminal
n1/config# interface ge0
n1/c/interface/ge0# description "Internet Connection"
n1/c/interface/ge0# ip address 203.0.113.1/24
n1/c/interface/ge0# exit

n1/config# interface ge1
n1/c/interface/ge1# description "LAN"
n1/c/interface/ge1# ip address 192.168.1.1/24
n1/c/interface/ge1# exit

n1/config# ip name-server 8.8.8.8
n1/config# ip name-server 1.1.1.1
n1/config# exit
n1# write

تست

n1# test ip name-server google.com
Resolved google.com as 142.250.185.78

n1# test ip name-server yahoo.com
Resolved yahoo.com as 98.137.11.163

n1# ping google.com
PING google.com (142.250.185.78) 56(84) bytes of data.
64 bytes from 142.250.185.78: icmp_seq=1 ttl=57 time=12.3 ms

سناریو ۲: DNS Relay برای شبکه داخلی

توپولوژی

Internet (DNS: 8.8.8.8)
    |
    | ge0: 203.0.113.1/24
  [Soodar Router]
    | ge1: 192.168.1.1/24
    |
  +-----------+-----------+
  |           |           |
Client1   Client2   Server1
(DHCP)    (DHCP)   192.168.1.10

هدف

روتر به عنوان DNS relay برای کلاینت‌های داخلی عمل کند و hostname های محلی را نیز حل کند.

پیکربندی

مرحله ۱: تنظیم اینترفیس‌ها

n1# config terminal
n1/config# interface ge0
n1/c/interface/ge0# description "Internet"
n1/c/interface/ge0# ip address 203.0.113.1/24
n1/c/interface/ge0# exit

n1/config# interface ge1
n1/c/interface/ge1# description "Internal LAN"
n1/c/interface/ge1# ip address 192.168.1.1/24
n1/c/interface/ge1# exit

مرحله ۲: تنظیم DNS

n1/config# ip name-server 8.8.8.8
n1/config# ip name-server 1.1.1.1
n1/config# ip name-server 0.0.0.0

مرحله ۳: تعریف hostname های محلی

n1/config# ip host server1 192.168.1.10
n1/config# ip host www.local.com 192.168.1.10
n1/config# ip host fileserver 192.168.1.20
n1/config# ip host printserver 192.168.1.30
n1/config# exit
n1# write

تست از روتر

n1# show ip name-server
Reference VRF for lookups: default
VRF Settings:
  VRF: default
    Name Servers:
      - 8.8.8.8
      - 1.1.1.1
    Nameservers Source: Manual CLI
    DNS Relay Enabled: yes

n1# show ip host
VRF Settings:
  VRF: default
    Hostnames:
      - server1: 192.168.1.10
      - www.local.com: 192.168.1.10
      - fileserver: 192.168.1.20
      - printserver: 192.168.1.30

n1# test ip name-server server1
Resolved server1 as 192.168.1.10

n1# test ip name-server google.com
Resolved google.com as 142.250.185.78

تست از کلاینت

در کلاینت، DNS را روی 192.168.1.1 تنظیم کنید:

# تنظیم DNS در کلاینت لینوکس
echo "nameserver 192.168.1.1" > /etc/resolv.conf

# تست حل نام محلی
nslookup server1 192.168.1.1
Server:     192.168.1.1
Address:    192.168.1.1#53

Name:    server1
Address: 192.168.1.10

# تست حل نام خارجی
nslookup google.com 192.168.1.1
Server:     192.168.1.1
Address:    192.168.1.1#53

Non-authoritative answer:
Name:    google.com
Address: 142.250.185.78

سناریو ۳: DNS با چندین VRF

توپولوژی

                    Internet
                  (DNS: 8.8.8.8)
                       |
                  ge0: 203.0.113.1/24
                   [Soodar]
        _____________|_____________
       |             |             |
    ge1: VRF       ge2: VRF     ge3: VRF
    Sales          HR           IT
  10.1.0.1/24   10.2.0.1/24  10.3.0.1/24
       |             |             |
   Sales Dept    HR Dept       IT Dept

هدف

ایجاد جداسازی کامل DNS بین بخش‌های مختلف سازمان با استفاده از VRF.

پیکربندی

مرحله ۱: ایجاد VRF ها

n1# config terminal
n1/config# ip vrf sales
n1/config-vrf# exit
n1/config# ip vrf hr
n1/config-vrf# exit
n1/config# ip vrf it
n1/config-vrf# exit

مرحله ۲: تنظیم اینترفیس‌ها

n1/config# interface ge0
n1/c/interface/ge0# description "Internet"
n1/c/interface/ge0# ip address 203.0.113.1/24
n1/c/interface/ge0# exit

n1/config# interface ge1
n1/c/interface/ge1# description "Sales Department"
n1/c/interface/ge1# ip vrf forwarding sales
n1/c/interface/ge1# ip address 10.1.0.1/24
n1/c/interface/ge1# exit

n1/config# interface ge2
n1/c/interface/ge2# description "HR Department"
n1/c/interface/ge2# ip vrf forwarding hr
n1/c/interface/ge2# ip address 10.2.0.1/24
n1/c/interface/ge2# exit

n1/config# interface ge3
n1/c/interface/ge3# description "IT Department"
n1/c/interface/ge3# ip vrf forwarding it
n1/c/interface/ge3# ip address 10.3.0.1/24
n1/c/interface/ge3# exit

مرحله ۳: تنظیم DNS برای هر VRF

n1/config# ip name-server 8.8.8.8
n1/config# ip name-server 1.1.1.1

n1/config# ip name-server vrf sales 0.0.0.0
n1/config# ip name-server vrf hr 0.0.0.0
n1/config# ip name-server vrf it 0.0.0.0

مرحله ۴: تنظیم VRF ها برای استفاده از DNS پیش‌فرض

n1/config# ip vrf sales
n1/config-vrf# ip domain-lookup vrf default
n1/config-vrf# exit

n1/config# ip vrf hr
n1/config-vrf# ip domain-lookup vrf default
n1/config-vrf# exit

n1/config# ip vrf it
n1/config-vrf# ip domain-lookup vrf default
n1/config-vrf# exit

مرحله ۵: تعریف hostname های خاص هر بخش

n1/config# ip host vrf sales sales-server 10.1.0.10
n1/config# ip host vrf sales crm-system 10.1.0.20

n1/config# ip host vrf hr hr-portal 10.2.0.10
n1/config# ip host vrf hr payroll 10.2.0.20

n1/config# ip host vrf it dev-server 10.3.0.10
n1/config# ip host vrf it gitlab 10.3.0.20
n1/config# ip host vrf it jenkins 10.3.0.30
n1/config# exit
n1# write

بررسی تنظیمات

n1# show ip name-server
Reference VRF for lookups: default
VRF Settings:
  VRF: default
    Name Servers:
      - 8.8.8.8
      - 1.1.1.1
    Nameservers Source: Manual CLI
    DNS Relay Enabled: no
  VRF: sales
    Name Servers:
    Nameservers Source:
    DNS Relay Enabled: yes
    Upstream Lookup VRF: default
  VRF: hr
    Name Servers:
    Nameservers Source:
    DNS Relay Enabled: yes
    Upstream Lookup VRF: default
  VRF: it
    Name Servers:
    Nameservers Source:
    DNS Relay Enabled: yes
    Upstream Lookup VRF: default
n1# show ip host
VRF Settings:
  VRF: default
    Hostnames:
  VRF: sales
    Hostnames:
      - sales-server: 10.1.0.10
      - crm-system: 10.1.0.20
  VRF: hr
    Hostnames:
      - hr-portal: 10.2.0.10
      - payroll: 10.2.0.20
  VRF: it
    Hostnames:
      - dev-server: 10.3.0.10
      - gitlab: 10.3.0.20
      - jenkins: 10.3.0.30

تست

n1# test ip name-server sales-server sales
Resolved sales-server as 10.1.0.10

n1# test ip name-server hr-portal hr
Resolved hr-portal as 10.2.0.10

n1# test ip name-server google.com sales
Resolved google.com as 142.250.185.78

n1# test ip name-server google.com it
Resolved google.com as 142.250.185.78

نکته

هر VRF فقط hostname های خود را می‌بیند اما می‌تواند از DNS سرورهای VRF پیش‌فرض برای حل نام‌های خارجی استفاده کند.

سناریو ۴: Reference VRF (مدیریت متمرکز DNS)

توپولوژی

         Primary Internet        Backup Internet
         (DNS: 8.8.8.8)         (DNS: 9.9.9.9)
                |                      |
           ge0: 203.0.113.1/24    ge4: 151.11.49.5/24
              VRF: internet        VRF: backup-internet
                   |                      |
                   +----------+-----------+
                              |
                          [Soodar]
                   ___________|___________
                  |           |           |
                ge1:        ge2:        ge3:
             VRF: sales  VRF: hr    VRF: dev
           10.1.1.1/24  10.2.1.1/24  10.3.1.1/24
                  |           |           |
              Sales        HR          Dev

هدف

مدیریت متمرکز DNS برای تمام VRF ها با قابلیت تغییر سریع به backup.

پیکربندی

مرحله ۱: ایجاد VRF ها

n1# config terminal
n1/config# ip vrf internet
n1/config-vrf# exit
n1/config# ip vrf backup-internet
n1/config-vrf# exit
n1/config# ip vrf sales
n1/config-vrf# exit
n1/config# ip vrf hr
n1/config-vrf# exit
n1/config# ip vrf dev
n1/config-vrf# exit

مرحله ۲: تنظیم اینترفیس‌ها

n1/config# interface ge0
n1/c/interface/ge0# description "Primary Internet"
n1/c/interface/ge0# ip vrf forwarding internet
n1/c/interface/ge0# ip address 203.0.113.1/24
n1/c/interface/ge0# exit

n1/config# interface ge4
n1/c/interface/ge4# description "Backup Internet"
n1/c/interface/ge4# ip vrf forwarding backup-internet
n1/c/interface/ge4# ip address 151.11.49.5/24
n1/c/interface/ge4# exit

n1/config# interface ge1
n1/c/interface/ge1# description "Sales"
n1/c/interface/ge1# ip vrf forwarding sales
n1/c/interface/ge1# ip address 10.1.1.1/24
n1/c/interface/ge1# exit

n1/config# interface ge2
n1/c/interface/ge2# description "HR"
n1/c/interface/ge2# ip vrf forwarding hr
n1/c/interface/ge2# ip address 10.2.1.1/24
n1/c/interface/ge2# exit

n1/config# interface ge3
n1/c/interface/ge3# description "Development"
n1/c/interface/ge3# ip vrf forwarding dev
n1/c/interface/ge3# ip address 10.3.1.1/24
n1/c/interface/ge3# exit

مرحله ۳: تنظیم DNS سرورها

n1/config# ip name-server vrf internet 8.8.8.8
n1/config# ip name-server vrf internet 1.1.1.1

n1/config# ip name-server vrf backup-internet 9.9.9.9
n1/config# ip name-server vrf backup-internet 149.112.112.112

مرحله ۴: تنظیم Reference VRF

n1/config# ip domain-lookup vrf-reference internet

مرحله ۵: تنظیم VRF های بخش‌ها

n1/config# ip vrf sales
n1/config-vrf# ip domain-lookup vrf-reference
n1/config-vrf# exit

n1/config# ip vrf hr
n1/config-vrf# ip domain-lookup vrf-reference
n1/config-vrf# exit

n1/config# ip vrf dev
n1/config-vrf# ip domain-lookup vrf-reference
n1/config-vrf# exit

مرحله ۶: فعال‌سازی DNS Relay

n1/config# ip name-server vrf sales 0.0.0.0
n1/config# ip name-server vrf hr 0.0.0.0
n1/config# ip name-server vrf dev 0.0.0.0

مرحله ۷: تعریف hostname ها

n1/config# ip host vrf sales sales-server 10.1.1.10
n1/config# ip host vrf hr hr-server 10.2.1.10
n1/config# ip host vrf dev dev-server 10.3.1.10
n1/config# exit
n1# write

تست عملکرد

n1# test ip name-server google.com sales
Resolved google.com as 142.250.185.78

n1# test ip name-server sales-server sales
Resolved sales-server as 10.1.1.10

n1# test ip name-server hr-server hr
Resolved hr-server as 10.2.1.10

n1# test ip name-server google.com dev
Resolved google.com as 142.250.185.78

تغییر به Backup Internet

در صورت مشکل در اینترنت اصلی:

n1# config terminal
n1/config# ip domain-lookup vrf-reference backup-internet
n1/config# exit
n1# write

حالا تمام VRF ها از DNS سرورهای backup-internet استفاده می‌کنند بدون نیاز به تغییر در پیکربندی هر VRF.

مزایای این روش

مدیریت متمرکز: تنها یک نقطه برای تغییر DNS
تغییر سریع: سوئیچ آسان بین primary و backup
مقیاس‌پذیری: افزودن VRF جدید بدون نیاز به تنظیمات DNS
جداسازی: hostname های محلی هر VRF مستقل است

سناریو ۵: یکپارچگی با DHCP

توپولوژی

   ISP DHCP Server
   (DNS: 8.8.8.8, 1.1.1.1)
          |
     ge0 (DHCP Client)
       [Soodar]
     ge1: 192.168.1.1/24
          |
      LAN Clients

هدف

دریافت خودکار DNS از ISP و ارائه DNS relay به کلاینت‌های داخلی.

پیکربندی

مرحله ۱: تنظیم DHCP Client

n1# config terminal
n1/config# interface ge0
n1/c/interface/ge0# description "ISP Connection"
n1/c/interface/ge0# ip address dhcp
n1/c/interface/ge0# exit

مرحله ۲: تنظیم شبکه داخلی

n1/config# interface ge1
n1/c/interface/ge1# description "Internal LAN"
n1/c/interface/ge1# ip address 192.168.1.1/24
n1/c/interface/ge1# exit

مرحله ۳: فعال‌سازی DNS Relay

n1/config# ip name-server 0.0.0.0

مرحله ۴: تعریف hostname های محلی

n1/config# ip host router 192.168.1.1
n1/config# ip host server1 192.168.1.10
n1/config# exit
n1# write

بررسی

n1# show ip name-server
Reference VRF for lookups: default
VRF Settings:
  VRF: default
    Name Servers:
      - 8.8.8.8
      - 1.1.1.1
    Nameservers Source: DHCP
    DNS Relay Enabled: yes

نکته مهم

اولویت DNS سرورها:

  1. DNS دریافتی از DHCP همیشه اولویت دارد

  2. DNS های دستی تنها زمانی استفاده می‌شوند که DHCP فعال نباشد

  3. برای حذف DNS های DHCP باید DHCP client را غیرفعال کنید

حذف تنظیمات DHCP:

n1# config terminal
n1/config# interface ge0
n1/c/interface/ge0# no ip address dhcp
n1/c/interface/ge0# ip address <STATIC-IP>

سناریو ۶: DNS با مسیریابی پیشرفته

توپولوژی

      Internet                Internet
    DNS: 8.8.8.8            DNS: 1.1.1.1
         |                       |
    ge0: ISP-1              ge1: ISP-2
    200.1.1.1/30           200.2.2.1/30
         |                       |
         +--------[R1]-----------+
                     |
                ge2: 10.0.0.1/24
                     |
                 LAN Users

هدف

استفاده از DNS سرورهای دو ISP مختلف با load balancing و failover.

پیکربندی

تنظیمات اولیه

n1# config terminal
n1/config# interface ge0
n1/c/interface/ge0# description "ISP-1"
n1/c/interface/ge0# ip address 200.1.1.1/30
n1/c/interface/ge0# exit

n1/config# interface ge1
n1/c/interface/ge1# description "ISP-2"
n1/c/interface/ge1# ip address 200.2.2.1/30
n1/c/interface/ge1# exit

n1/config# interface ge2
n1/c/interface/ge2# description "LAN"
n1/c/interface/ge2# ip address 10.0.0.1/24
n1/c/interface/ge2# exit

تنظیم DNS

n1/config# ip name-server 8.8.8.8
n1/config# ip name-server 1.1.1.1
n1/config# ip name-server 0.0.0.0
n1/config# exit
n1# write

سیستم به صورت خودکار از هر دو DNS استفاده می‌کند و در صورت مشکل یکی، از دیگری استفاده می‌نماید.

نکات مهم و بهترین شیوه‌ها

امنیت

نکات امنیتی

  1. فیلتر DNS: از ACL برای محدود کردن دسترسی به DNS relay استفاده کنید

  2. جداسازی: از VRF برای جداسازی ترافیک DNS بخش‌های مختلف استفاده کنید

  3. DNS امن: در صورت امکان از DNS سرورهای داخلی و امن استفاده کنید

  4. نظارت: لاگ‌های DNS را برای شناسایی فعالیت‌های مشکوک بررسی کنید

عملکرد

بهینه‌سازی

  1. چند DNS: همیشه چندین DNS سرور تعریف کنید برای redundancy

  2. DNS محلی: برای سرورهای پراستفاده از hostname محلی استفاده کنید

  3. Reference VRF: در شبکه‌های بزرگ از reference VRF برای مدیریت آسان‌تر استفاده کنید

  4. Cache: سیستم DNS caching دارد، نیازی به پیکربندی اضافی نیست

مدیریت

توصیه‌های مدیریتی

  1. مستندسازی: تمام hostname ها و mapping های DNS را مستند کنید

  2. نام‌گذاری: از نام‌گذاری سازمان‌یافته برای hostname ها استفاده کنید

  3. تست منظم: به طور دوره‌ای DNS resolution را تست کنید

  4. پشتیبان‌گیری: از تنظیمات DNS در backup های منظم نگهداری کنید

عیب‌یابی

مشکل ۱: DNS کار نمی‌کند

علائم:

  • test ip name-server خطا می‌دهد

  • ping به domain کار نمی‌کند

راه‌حل:

# بررسی تنظیمات DNS
n1# show ip name-server

# بررسی دسترسی شبکه به DNS سرور
n1# ping 8.8.8.8

# تست مستقیم
n1# test ip name-server google.com

# بررسی مسیریابی
n1# show ip route

مشکل ۲: DNS Relay کار نمی‌کند

علائم:

  • کلاینت‌ها نمی‌توانند از DNS روتر استفاده کنند

راه‌حل:

# بررسی فعال بودن DNS relay
n1# show ip name-server
# باید "DNS Relay Enabled: yes" نمایش دهد

# اگر خیر، فعال کنید:
n1# config terminal
n1/config# ip name-server 0.0.0.0

# بررسی VRF
n1# show ip name-server
# اطمینان از اینکه interface و DNS relay در یک VRF هستند

مشکل ۳: hostname های محلی کار نمی‌کنند

علائم:

  • DNS عمومی کار می‌کند اما hostname های محلی حل نمی‌شوند

راه‌حل:

# بررسی تعریف hostname ها
n1# show ip host

# بررسی VRF صحیح
n1# test ip name-server <hostname> <vrf-name>

# افزودن hostname در صورت نیاز
n1# config terminal
n1/config# ip host <hostname> <ip-address>

مشکل ۴: VRF نمی‌تواند DNS resolve کند

علائم:

  • DNS در VRF پیش‌فرض کار می‌کند اما در VRF خاص خیر

راه‌حل:

# بررسی تنظیمات VRF
n1# show ip name-server

# تنظیم lookup از VRF دیگر
n1# config terminal
n1/config# ip vrf <vrf-name>
n1/config-vrf# ip domain-lookup vrf-reference
n1/config-vrf# exit

# یا تنظیم DNS مستقیم در VRF
n1/config# ip name-server vrf <vrf-name> 8.8.8.8

# فعال‌سازی DNS relay در VRF
n1/config# ip name-server vrf <vrf-name> 0.0.0.0

مشکل ۵: تضاد DHCP و تنظیمات دستی

علائم:

  • DNS های دستی استفاده نمی‌شوند

راه‌حل:

# بررسی منبع DNS
n1# show ip name-server
# اگر "Nameservers Source: DHCP" باشد:

# غیرفعال کردن DHCP client در صورت نیاز
n1# config terminal
n1/config# interface <interface-name>
n1/c/interface/<interface-name># no ip address dhcp
n1/c/interface/<interface-name># ip address <static-ip>/<mask>

جدول مرجع سریع

دستورات پیکربندی

دستور

کاربرد

ip name-server <IP>

افزودن DNS سرور در VRF پیش‌فرض

ip name-server vrf <VRF> <IP>

افزودن DNS سرور در VRF خاص

ip name-server 0.0.0.0

فعال‌سازی DNS relay

ip host <NAME> <IP>

تعریف hostname محلی

ip host vrf <VRF> <NAME> <IP>

تعریف hostname در VRF خاص

ip domain-lookup vrf-reference <VRF>

تنظیم VRF مرجع

ip domain-lookup vrf-reference

استفاده از VRF مرجع

ip domain-lookup vrf <VRF>

استفاده از VRF خاص

دستورات نمایش

دستور

کاربرد

show ip name-server

نمایش تنظیمات DNS تمام VRF ها

show ip host

نمایش hostname های تعریف شده

test ip name-server <HOST> [VRF]

تست حل نام

دستورات حذف

دستور

کاربرد

no ip name-server <IP>

حذف DNS سرور

no ip name-server vrf <VRF> <IP>

حذف DNS سرور از VRF

no ip host <NAME>

حذف hostname

no ip host vrf <VRF> <NAME>

حذف hostname از VRF

خلاصه

سیستم DNS در روتر سودار یک راه‌حل جامع و قدرتمند برای مدیریت نام‌ها در شبکه است:

پشتیبانی کامل VRF برای جداسازی ترافیک
DNS Relay برای سرویس‌دهی به کلاینت‌ها
Hostname های محلی برای دستگاه‌های داخلی
Reference VRF برای مدیریت متمرکز
یکپارچگی DHCP برای تنظیمات خودکار
انعطاف‌پذیری بالا در پیکربندی

با استفاده صحیح از این قابلیت‌ها می‌توانید یک زیرساخت DNS مقیاس‌پذیر، امن و قابل مدیریت برای شبکه خود ایجاد کنید.