DNS and BIND : Charpter 2 : How Does DNS Work

Submitted by joezine on Sun, 06/28/2009 - 18:18

The Domain Name Space

  • DNS แบ่ง Database เป็น index โดยใช้ Domain Name
  • แต่ละ Domain มี Tree เรียกว่า Domain Name Space
  • โครงสร้างของ Tree คล้ายกับ Unix Filesystem (ตามรูปด้านล่าง)

Domain Names

  • ยาวได้ 63 characters
  • ค่าว่างเปล่า (หรือยาว = 0) สำรองให้กับ Root
  • อันที่จริงต้องเขียน Domain เป็น “www.oreilly.com.” (. คือ Root) แต่เพื่อความสะดวกเลยตัด . ทิ้ง

  • จากรู​ปด้านบน (เหมือน Unix File System) ตรงที่ ใน Node ต้องมี Children ที่แตกต่างกัน

Domain

  • เป็นส่วนหนึ่งของ Domain name Space เช่น purdue.edu (ตามรูปด้านล่าง)

  • สรุปคือ Domain เป็น Sub Tree ของ Domain Name Space
  • Domain จะมีหลาย Sub Tree เรียกว่า Subdomain เช่น la.tyrell.com เป็น subdomain ของ tyrell.com
  • เช่นเดียวกัน tyrell.com เป็น subdomain ของ com แต่ทั้งหมดจะมี level ของมัน

The Internet Domain Name Spece

Top-Level Domain

  • แยกเป็น 7 Domain เช่น com, edu, gov, mil, net, org, int
  • ถ้าแบบอื่นเรียก arpa
  • นอกจากนี้มี generic top-level domains (gTLDs) เช่น biz, info, pro
  • องค์กรที่ทำหน้าที่จัดการ domain name system คือ ICANN ที่จะเพิ่ม gTLDs ใหม่ๆ

Further Down

  • ถ้าเป็น UK ควรจะเป็น gb แต่ส่วนใหญ่ใช้ uk แล้ว
  • ถ้าเป็น USA ขะมี subdomains ที่อยู่ภายใต้ us รวม 50 domain (เป็นรัฐ) และ portal service ของ USA เท่านั้น

Name Servers and Zones

  • Name Server จะเก็บข้อมูลของ Domain (Zone) เช่น จากรูปด้านล่างจะมี Zone แบ่งออกมาเรื่อยๆ (แล้วแต่ว่าจะทำ Delegate Domain หรือไม่)

  • ยกตัวอย่าง subdomain berkeley.edu ต้องการ delegate หลาย zone คือ cc, cs, ce, me และ อื่นๆ (ตามรูปด้านล่าง)

  • ประเภทของ Name Server มี Primary masters กับ Secondary masters (เรียกว่า Authoritative)

    • Primary Masters : มีไว้ให้ Zone อ่านข้อมูลจาก file บนตัว hosts ของมันเอง
    • Secondary Masters : ให้ Zone รับข้อมูลจาก name server ที่อื่น (จาก master server) และ load zone จาก secondary อื่นๆได้ด้วย (ใช้ zone transfer) และใช้เป็น Redundancy ด้วย
  • Zone Data Files เป็น Database ของ Domain

Resolvers

  • เป็นโปรแกรมที่ client ที่จะเข้าไปถามข้อมูลจาก domain name space ไว้จัดการเรื่องานตามนี้

    • query name server
    • ดูการตอบสนอง (record อาจจะ error)
    • return ข้อมูลที่โปรแกรมร้องขอ
  • ยกตัวอย่างเช่น telnet, ftp, nslookup

Resolution

  • กรณี

Root Name Servers

  • Root Name Server รู้ว่า authoritative name server ของแต่ละ tld อยู่ที่ไหน
  • Root Name Server มีความสำคัญมากกับ Resolution เพราะเป็นจุด Start
  • จากรูปด้านล่าง เป็นการแสดง Resolution Process

Recursion

  • การ Query เข้ามา 2 รูปแบบ คือ Recursion และ Iterative (or non-recursive) Iteration
    Choosing Between Authoritative Name Servers
    The Whole Enchilada

จากรูปด้านล่างเป็น Process ของ Resolution

  • Resolver query local name server
  • *

Mapping Address to Names
Inverse Queries

Caching

Time to Live

Tags: | »

Post new comment

The content of this field is kept private and will not be shown publicly.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>. Beside the tag style "<foo>" it is also possible to use "[foo]". PHP source code can also be enclosed in <?php ... ?> or <% ... %>.
  • You can use Markdown syntax to format and style the text. Also see and Markdown Extra for tables, footnotes, and more.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
1 + 0 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.