Upload
scott-adams
View
212
Download
0
Embed Size (px)
Citation preview
2
Overview
Provide a mechanism for naming resources User’s view Resolver’s view Two kinds of data:
Authoritative Cache
3
Common configuration
User
Program
Local host
User queries
User responses
Resolver
cache
responses
queries
cache additions reference
Foreign
Foreign
Name
Server
4
Common configuration(cont.)
Master
files
Local host
Name
Server
Foreign
Resolver
Foreign
Name
Server
Foreign
maintenance responses
queriesmaintenance queries
responses
5
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.
6
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
7
RR definitions--Format
NAME
TYPE
CLASS
TTL
RDLENGTH
RDATA
1111110123456789012345
8
RR definitions(cont.)--TYPE values
TYPE Value and meaning TYPE Value and meaning
A 1 a host address MR 9 a mail domain name(EXP)
NS 2 an authoritative name server NULL 10 a null RR(EXP)
MD 3 a mail destination(obsolete) WKS 11 a well know service description
MF 4 a mail forwarder(obsolete) PTR 12 a domain name pointer
CNAME 5 the canonical name for an alias HINFO 13 a host information
SOA 6 marks the start of a zone of
authority
MINFO 14 mailbox or mail list information
MB 7 a mailbox domain name(EXP) MX 15 mail exchange
MG 8 a mail group(EXP) TXT 16 txt strings
9
RR definitions(cont.)
QTYPEQTYPE value and meaning
AXFR 252 A request for a transfer of an entire zone
MAILB 253 A request for mailbox-related records(MB, MG or MR)
MAILA 254 A request for mail agent RRs (Obsolete)
* 255 A request for all records
CLASSvalue and meaning
IN 1 the Internet
CS 2 the CSNET class(Obsolete)
CH 3 the CHAOS class
HS 4 Hesiod
QCLASS
value and meaning
* 255 any class
10
RR definitions(cont.) –SOA RDATA format
MNAME
RNAME
SERIAL
REFRESH
RETRY
EXPIRE
MINIMUM
11
Messages--Format
Header
Question
Answer
Authority
Additional
ID
QR Opcode AA TC RD RA Z Opcode
QDCOUNT
ANCOUNT
NSCOUNT
ARCOUNT
1111110123456789012345
12
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
13
Messages(cont.)—Question section format
1111110123456789012345
QNAME
QTYPE
QCLASS
14
Messages(cont.)—Resource record format
The answer, authority, and additional sections 1111110123456789012345
NAME
TYPE
CLASS
TTL
RDLENGTH
RDATA
15
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>
16
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; };};
17
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 Servers30 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.
18
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.222mis IN A 163.13.200.32sun IN A 163.13.200.33www IN CNAME sunwwwbbs IN A 163.13.200.37
IN MX 0 wwwbbs.im.tku.edu.tw.bbs IN A 163.13.200.40