190 likes | 334 Views
RFC #1035. Domain Names Implementation and specification. 陳怡良 cyl@mail.im.tku.edu.tw. Overview. Provide a mechanism for naming resources User’s view Resolver’s view Two kinds of data: Authoritative Cache. Local host. Foreign. User queries. queries. User Program. Resolver.
E N D
RFC #1035 Domain Names Implementation and specification 陳怡良 cyl@mail.im.tku.edu.tw
Overview • Provide a mechanism for naming resources • User’s view • Resolver’s view • Two kinds of data: • Authoritative • Cache
Local host Foreign User queries queries User Program Resolver Foreign Name Server User responses responses cache additions reference cache Common configuration
Local host Foreign responses Foreign Resolver Name Server Master files queries maintenance queries Foreign Name Server maintenance responses Common configuration(cont.)
Conventions Preferred name syntax • <domain> ::= <subdomain> | “ “ • <subdomain> ::= <subdomain> “.” <label> • <label> ::= <letter> [[ <ldh-str> ] <let-dig> ] • <ldh-str> ::= <let-dig-hyp> | <let-dig-hyp> <ldh-str> • <let-dig-hyp> ::= <let-dig> | “=“ • <let-dig> ::= <letter> | <digit> • <letter> ::= [A-Z][a-z] • <digit> ::= [0-9] PS.Labels must be 63 characters or less.
Conventions(cont.) Data Transmission Order--octets Character Case—case-insensitive Size limits • labels 63 octets or less • names 255 octets or less • TTL positive values of a signed 32 bit number • UDP messages 512 octets or less
RR definitions--Format 111111 0123456789012345
Messages(cont.)--Format OPCODE 0 QUERY 1 IQUERY 2 STATUS 3-15 reserved RCODE 0 No error condition 1 Format error 2 Server failure 3 Name Error 4 Not Implemented 5 Refused 6-15 reserved
111111 0123456789012345 Messages(cont.)—Question section format
111111 0123456789012345 Messages(cont.)—Resource record format • The answer, authority, and additional sections
Resolver Implementation& Mail support • Transforming a user request into a query • Sending the queries • Processing responses • Using the cache Mail support • <local-part>@<mail-domain>
Master Files相關範例—named.conf節錄 zone "200.13.163.IN-ADDR.ARPA" { type master; file "rev.200"; }; zone "im.tku.edu.tw" { type master; file "hosts.im"; allow-update { none; }; };
Master Files相關範例(cont.)—rev.200節錄 $TTL 86400; @ IN SOA mail.im.tku.edu.tw. root.mail.im.tku.edu.tw. ( 2000092915 ; Serial 43200 ; Refresh 3600 ; Retry 3600000 ; Expire 2419200 ) ; Minimum IN NS mail.im.tku.edu.tw. IN NS mis.im.tku.edu.tw. IN NS tkgis.tku.edu.tw. ;IMNA Servers 30 IN PTR web.im.tku.edu.tw. 32 IN PTR mis.im.tku.edu.tw. 33 IN PTR sun.im.tku.edu.tw. 37 IN PTR wwwbbs.im.tku.edu.tw. 39 IN PTR ftp.im.tku.edu.tw. 40 IN PTR bbs.im.tku.edu.tw. 222 IN PTR mail.im.tku.edu.tw.
Master Files相關範例(cont.)—hosts.im節錄 $TTL 86400; @ IN SOA mail.im.tku.edu.tw. root.mail.im.tku.edu.tw. ( 2001092980 ; Serial 10800 ; Refresh 3600 ; Retry 3600000 ; Expire 2419200) ; Time to live IN NS mail.im.tku.edu.tw. IN NS mis.im.tku.edu.tw. IN MX 1 mail.im.tku.edu.tw. IN MX 2 mis.im.tku.edu.tw. mail IN A 163.13.200.222 mis IN A 163.13.200.32 sun IN A 163.13.200.33 www IN CNAME sun wwwbbs IN A 163.13.200.37 IN MX 0 wwwbbs.im.tku.edu.tw. bbs IN A 163.13.200.40