Dns:domain name System (convert domain name and IP address to each other)
A domain name is a range, such as baidu.com,.com. And www.baidu.com is a hostname, that is, Fqdn:full qualified domain name, fully qualified domains), many host names constitute a domain name.
DNS is primarily used for name resolution (named Resolving), which is essentially name translation, but is called parsing because it involves database queries.
Fqdn<-->ip
192.168.0.220 www.zdx.com
192.168.0.250 mail.zdx.com
Nsswitch just provides a platform, the specific parsing process is done according to the libness_files.so,libness_dns.so two shared objects
There is a line in Nsswitch:
Hosts:files DNS
where files:/etc/hosts by Libness_files find/etc/hosts file
Dns:dns
Stub resolver: Name resolver
Hosts file format:
IPAddr FQDN ailases
192.168.0.220 www.zdx.com www
Synchronize the hosts mode:
1. Recurring tasks
2, server, server
1KW
3. Distributed database
IANA (United States): Ip,fqdn
ICANN (International)
Tld:top level Domain
Organization domain:. com,. org,. NET,. cc
Country domain:. cn,. TW,. HK,. IQ,. IR,. JP
Reverse Domain: IP-->FQDN
Reverse: Ip-->fqdn
Forward: Fqdn-->ip
Ip-->fqdn:
FQDN-->IP:
Www.magedu.com.IP1
Inquire:
Recursive: Only one request is issued
Iteration: Making multiple requests
Analytical:
Forward: Fqdn-->ip
Reverse: Ip-->fqdn
Two-stage: recursive, iterative
DNS: Distributed Database
The superior only knows its direct subordinate;
Subordinates only know the location of the root;
DNS server:
Accept local Customer query requests (recursive)
External client Request: Request authoritative Answer
Affirmative Answer: TTL
Negative Answer: TTL
External client Request: Non-authoritative answer
DNS server type
Primary DNS server: Data modification
Secondary DNS server: Request data synchronization
Serial number
Refresh
Retry
Expire
Negative Answer TTL
Caching DNS servers
Transponder
In the database, each entry is referred to as a resource record (Resource record, RR)
Format of the resource record:
TTL 600;
Internetresource Record Type
NAME[TTL] Inrrtvalue
www.magedu.com.INA1.1.1.1
1.1.1.1inptrwww.magedu.com.
Resource record Type:
SOA (Start of authority):
ZONE Namettlinsoafqdnadministrator_mailbox (
Serial number
Refresh
Retry
Expire
Na ttl)
Time units: M (minutes), H (Hours), D (days), W (week), default unit is seconds
Email format: [email protected]-write as Admin.magedu.com
Magedu.com.600insoans1.magedu.com.admin.magedu.com. (
2013040101
1H
5M
1W
1D)
NS (name Server): ZONE Name---FQDN
Magedu.com.600innsns1.magedu.com.
Magedu.com.600innsns2.magedu.com.
ns1.magedu.com.600ina1.1.1.2
ns2.magedu.com.600ina1.1.1.5
MX (Mail eXchanger): ZONE NAME-to-FQDN
ZONE Namettlinmx Privalue
Priority: 0-99, the smaller the number the higher the level
Magedu.com.600inmx10mail.magedu.com.
mail.magedu.com.600ina1.1.1.3
A (address): Fqdn-->ipv4
Aaaa:fqdn-->ipv6
PTR (pointer): IP-->FQDN
CNAME (Canonical NAME): Fqdn-->fqdn
Www2.magedu.com.INCNAMEwww.magedu.com.
Txt
CHAOS
SRV
Domains: Domain
Zone: Zone
. com
Magedu.com.INNSns.magedu.com.
ns.magedu.com.ina192.168.0.10
Magedu.com. 192.168.0.0/24
www192.168.0.1
mail192.168.0.2, MX
Create two zone files:
Forward zone file
Magedu.com.INSOA
www.maged.com.INA192.168.0.1
Abbreviated as:
wwwINA192.168.0.1
Reverse zone file:
0.168.192.in-addr.arpa.insoa
1.0.168.192.in-addr.arpa.inptrwww.magedu.com.
1inptrwww.magedu.com.
Type of zone transfer:
Full zone transfer: AXFR all Transferation
Incremental zone transfer: IXFR increment transferation
Zone Type:
Primary zone: Master
From zone: Slave
Hint Area: hint
Forwarding Area: Forward
. com.
Magedu.com.
DNS resource record type and meaning:
SOA: Start authorization record
NS: Name server
MX: Mail Exchanger
CNAME: Alias Record
A:fqdn-->ipv4
Aaaa:fqdn-->ipv6
Ptr:ip-->fqdn
Recursion: Request Once
Iteration: Request multiple times, refer to answer
DNS Server type:
Main
Aided
Cache
Transponder
ZONE DOMAIN
Soa:
Mageedu.com172.16.100.0/24
ns172.16.100.1
www172.16.100.1, 172.16.100.3
mail172.16.100.2
FTP www
Dns:bind
Berkeley Internet Name Domain
Isc
BIND97:
/etc/named.conf
Working properties of the bind process
Definition of a region
/etc/rndc.key
Rndc:remote Name Domain Controller
Key file
Configuration information:/etc/rndc.conf
/var/named/
Zone Data files
/etc/rc.d/init.d/named
{Start|stop|restart|status|reload}
Binary program: Named
Bind-chroot:
Default: Named
Users: Named
Group: Named
/var/named/chroot/
etc/named.conf
Etc/rdnc.key
Sbin/named
var/named/
Cached-----from
Named-checkconfig
Name-checkzone
Dig:domain Information Gropher
Dns:
Protocols and ports for listening:
53/udp
53/tcp
953/TCP, RNDC
Socket: Socket
Ip:port
C/S: Client/server
172.16.100.1:53
192.168.0.13
192.168.0.12:53
172.16.100.1:53
0.0.0.0:53
Regional:
Zone "Zone NAME" in {
type {Master|slave|hint|forward};
};
Main area:
File "zone data Files";
From zone:
File "zone data Files";
Masters {master1_ip;};
To temporarily close SELinux:
# Getenforce
Enforcing
# Setenforce 0
# setenforce 1
Permanently closed:
# Vim/etc/selinux/config
Dig-t RT NAME @IP
Dig-t NS mageedu.com
Dig-x IP:
Finding FQDNs based on IP
HOST-T RT Name: Parse result of query name
Nslookup: Interactive
Nslookup>
Server IP
Set Q=rt
NAME
100.16.172.in-addr.arpa
DNS Learning notes of DNS theoretical knowledge