Lession 15 - DNS

  • Upload
    nam-vu

  • View
    235

  • Download
    0

Embed Size (px)

DESCRIPTION

GIới thiệu về DNS trên Linux

Citation preview

Slide 1

DNS ServerNi dungGii thiu dch v DNS.Hot ng ca dch v DNSFully Qualified Domain Name (FQDN)The in-addr.arpa DomainPhn gii request DNSTypes of DNS serverCi t dch v DNSCu hnh dch v DNSDNS toolsGii thiu dch v DNS my tnh ny c th lin lc vi my tnh kia, cn phi bit a ch IP.Ngi s dng kh khn trong vic nh a ch IP. Ngi s dng mun lin lc vi my tnh khc trong mng bng tn my tnh.Cn c mt bng map gia a ch IP v tn my tnh.Vi h thng mng nh, dng file text qun l.Vi mng Internet, s dng dch v DNS.Gii thiu dch v DNSDch v DNS Domain Name Service l dch v phn gii tn min.Dch v DNS s nh x t tn min sang a ch IP.Dch v DNS cho php ngi dng truy cp n cc my tnh khc bng tn, khng cn nh n a ch IP.Dch v DNS c hin thc bng phn mm Berkely Internet Name Domain system (BIND).

Phn gii request DNSrequest -> server DNS -> IP (a.b.c.d)domain name: tn min do Athena qun l.domain name: tn min do VNNIC qun l.domain name: tn min quc t.

request (domain name) -> server DNS -> IP (a.b.c.d)server DNS: DNS ca Athena.server DNS: DNS ca nh cung cp khc.Phn gii request DNS (tt)Tn min do Athena qun l:request -> Athena -> answer.domain name: tn min do VNNIC qun l.request -> Athena -> VNNIC -> ISP -> answer.domain name: tn min quc t.request -> Athena -> Root servers -> DNS primary -> answer.

Phn gii request DNS (tt)DNS Athena:request -> Viettel -> answer.DNS ca nh cung cp khc:request -> DNS server -> answer.request -> DNS server -> VNNIC -> Athena -> answer.

Phn gii request DNS (tt)Chi tit x l request ca DNS khng h tr mode recursive:

Phn gii request DNS (tt)Chi tit x l request ca DNS h tr mode recursive:

Type of DNS serverPrimary DNS serverSecondary DNS serverCaching/ Forwarding DNS server

Ci t dch v DNSCi t dch v DNS bng cc gi bindbind-utils-[version]bind-libs-[version]bind-[version]File cu hnh chnh ca dch v DNS:named.conf

Cu hnh dch v DNS (tt)

Option chungRoot serversnh ngha domainCu hnh dch v DNS (tt)DNS h tr cc bn ghi: SOA, NS, PTR, MX, A, CNAME.

Squid ServerNi dungGii thiu Squid serverCu hnh Squid serverOptionCu hnh ACLSquid AuthenticationGii thiu Squid serverSquid l mt caching proxy server. Squid server c t gia Web client v Web server.Khi c request yu cu Web page, Squid s kim tra, xc nhn tnh hp l ca request da trn nhng policy c nh ngha trong Squid. Sau , truy vn Web page tr v kt qu cho request. Nu kt qu c trong cache ca Squid, th Squid tr kt qu v ngay cho request.Gii thiu Squid server (tt)Squid server c th c ci t bng source hoc bng rpm. Squid server gm nhng file sau trong h thng:/etc/squid/usr/lib/squid/usr/sbin/squid/var/log/squidCu hnh Squid serverMt s option chnh cu hnh Squid server:http_port: port Squid server lng nghe request phc v. Mc nh l port 3128.cache_dir: nh ngha Squid server s cha cache ucache_dir storage_type directory-name megabytes L1 L2 [options] cache_dir ufs /var/spool/squid 10000 16 256 DirectoryMegabytesTop level directorySecond level directoryCu hnh Squid server (tt)cache_mem: Squid server s s dng bao nhiu memory ca RAM.cache_access_log: Squid server ghi nhn li cc request query Squid.acl: y l phn phc tp nht ca Squid server, cho php ngi no s c truy cp Web, truy cp nhng trang no.acl intranet src 192.168.1.0/24 http_access allow intranet http_access deny all

Cu hnh Squid server (tt)C th dng acl gii hn truy cp bng nhiu cch:Gii hn truy cp theo thi gian.Gii hn truy cp theo IP.Gii hn truy cp theo port.Gii hn truy cp theo giao thc.Gii hn truy cp theo trang web.Gii hn file c php download.Gii hn bng thng ti a c s dng.

Cu hnh Squid server (tt)

DHCP ServerNi dungGii thiu dch v DHCPchc nnggi ci t.File cu hnh/etc/dhcpd.conf./var/lib/dhcpd/dhcpd.leases.Lnh dhclientGii thiu dch vDHCPDHCP l dch v cung cp a ch IP ng cho cc my tnh trong h thng.DHCP cng cung cp ng cc tham s khc: DNS, gateway, cp IP tnh.DHCP c ci t bng hai gi:dhcp-[version].rpm.dhcp-devel-[version].rpm.Hoc ci t t gi source.File cu hnh chnh:/etc/dhcpd.conf.File /etc/dhcpd.conf

File dhcpd.leasesFile dhcpd.leases theo di tnh trng cp pht IP ng:

Lnh dhclientC th get IP ng bng cch iu chnh file:/etc/sysconfig/network-scripts/ifcfg-eth[n]BOOTPROTO = dhcpLnh dhclient: dng get IP ng t DHCP server.LDAPNi dungGii thiu Network DirectoryGii thiu LDAP protocolCu trc lu tr LDAP DirectoryGii thiu Openldapserver side daemonclient side commandNetwork DirectoryNetwork directory l mt cu trc dng t chc lu tr theo dng phn cp hnh cy.Network directory c t chc thun tin nht cho vic c v tm kim.Nu ng dng cn nhiu thao tc insert, update th khng nn lu tr theo kiu network directory.X.500 l mt network directory.

Gii thiu LDAP protocol truy vn network directory, ngi ta s dng giao thc DAP Directory Access Protocol.Giao thc ny qui nh mt tp lnh giao tip gia client v server lu tr (network directory) truy vn d liu cn thit.DAP hot ng da trn giao thc OSI.LDAP Lightweight Directory Access Protocol l giao thc ra i thay th DAP. LDAP nh ngha mt tp lnh giao tip gia client/server da trn giao thc TCP truy vn d liu directory.LDAP protocol (tt)

LDAP directory

uid=babs, ou=people, dc=example, dc=comDN: Distinguished NameRDN: Relative Distinguished NameLDAP directory (tt)cn=gerald carter, ou=people, dc=plainjoe, dc=com

attributeentry

LDAP directory (tt)Nhng schema v objectclass thng c dng u c nh ngha sn trong RFC.Khi mun nh ngha mt cu trc cy th mc, phn tch, quyt nh cn nhng attribute no, sau tm nhng objectclass, schema c nhng attribute ny.T , xy dng nn cu trc cy th mc.Nu khng c schema tha mn yu cu, c th nh ngha schema, objectclass mi.

LDAP directory (tt)

OPENLDAP (tt)Openldap l phn mm m ngun m, dng hin thc LDAP chy trn h iu hnh Linux/ UNIX.Pha server gm c hai dch v chnh:slapd: standalone LDAP daemon. Daemon ny lng nghe cc request truy vn LDAP t client, tin hnh truy vn, v gi cu tr li.slurpd: LDAP replication daemon. Daemon ny dng ng b nhng thay i t LDAP master server sang LDAP slave server. OPENLDAP (tt) truy vn LDAP, client dng nhng lnh sau:ldapadd: thm mt entry mi.ldapmodify: chnh sa thng tin mt entry.ldapdelete: xa mt entry.ldapmodrdn: chnh sa RDN ca entry.ldapsearch: tm kim thng tin entry.Hi & p