CS485G Spring 2015 64
(c) Class C: first octet 192-224; second and third octet 0-255. 2
8
ad-
dresses in region.
(d) Special purpose addresses: first octet 225-255.
(e) This division into classes is no longer followed.
(f) A network ID is written in the form w.x.y.z/n, where n is the
number of bits in a host address. For instance, CS uses the class
C region 128.163.146/8.
(g) Some regions are pre-allocated as private, unrouted addresses:
10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16.
16. Human-readable host names
(a) The Domain Name Service (DNS) maps IP addresses into a hi-
erarchy of names.
(b) First-level domain names: .net, .edu, .gov, .com
(c) Second level domain names: uky, mit, amazon
(d) Third level: cs, www.
(e) No limit on levels, and no particular conventions.
(f) The mapping is maintained in a huge distributed database, which
can be understood as a collection of host-entry structures.
1 struct hostent {
2 char
*
h_name;
/
*
official domain name of host
*
/
3 char
**
h_aliases;
/
*
null-terminated array of domain names
*
/
4 int h_addrtype;
/
*
host address type (AF_INET)
*
/
5 int h_length;
/
*
length of an address, in bytes
*
/
6 char
**
h_addr_list; /
*
null-terminated array of in_addr structs
*
/
7 }
(g) The gethostbyname() library call queries the DNS database.
(h) Queries in Unix are first checked in /etc/hosts. If that fails,
they are sent to a name server, as listed in /etc/resolv.conf.
(i) Command-line programs: nslookup, dig (Domain Informa-
tion Groper)
Kommentare zu diesen Handbüchern