DNS. Introduction What is DNS? –Hierarchy or Tree –Dot used as a separator.

Post on 24-Dec-2015

220 views 0 download

Transcript of DNS. Introduction What is DNS? –Hierarchy or Tree –Dot used as a separator.

DNS

Introduction

• What is DNS? – Hierarchy or Tree– Dot used as a separator

Top-level domain

Domain Name MeaningCOM Commercial organizationsEDU Educational institutionsGOV Government institutionsMIL Military groupsNET Major network support ORG Organizations other than those aboveARPA Temporary ARPANET domainINT International organizationscountry codeEach country (geographical scheme)

zone

• Domain Delegation

Primary (Master) Name Server– Contains the writable authoritative copy for th

e zones

Secondary (Slave) Name Server– Contains mirror copy of the data from a

primary nameserver

Introduction to DNS

• DNS Clients – /etc/resolv.conf

• Authoritative DNS Servers – provide the information for your DNS domain

• Caching DNS Server – Most servers don’t ask authoritative servers

for DNS directly – ask a caching DNS server

How Does It Work?

• Listens at UDP and TCP port 53 – UDP for routine queries – TCP used for zone transfers

Basic DNS Testing of DNS Resolution

• The Host Command– host www.google.com

• The nslookup Command– nslookup www.google.com– nslookup

The /etc/resolv.conf File

• Nameserver– IP address of your DNS nameserver

• Search

• Domain– localdomain use by default

search my-site.com my-site.net my-site.org

nameserver 192.168.1.100

nameserver 192.168.1.102

BIND

• Downloading and Installing the BIND

How To Get BIND Started

• service named start

• service named stop

• service named restart

DNS File Locations

• named.conf– /etc/named.conf

• zone files– /var/named

Named.conf

• This file usually has two zone areas: – Forward zone file – Reverse zone file

Forward zone file

zone "my-site.com" { type master;

file "my-site.zone";

};

Reverse zone file

zone "1.168.192.in-addr.arpa" { type master;

notify no;

file "192-168-1.zone";

};

Configuring The Zone Files

• By default located in the directory /var/named

• Each zone file contains a variety of records (SOA, NS, MX, A, and CNAME)

Time to Live Value

– D signifies days– W signifies weeks– H signifies hours

$TTL 3D

Standard Resource Records

• SOA– Start of Authority, Marks the begining of a zon

e's data

• NS – IP address or CNAME of the name server

• A– IP address of server

• MX– Mail server DNS name

• CNAME– Server name alias

• PTR– Last octet of server's IP address

The SOA Record

• FormatName Class Type Name-Server Email-Address Serial-No Refresh

Retry Expiry Minimum-TTL

@ IN SOA ns1.my-site.com. hostmaster.my-site.com. ( 2004100801  ; serial #

4H  ; refresh

1H  ; retry

1W  ; expiry

1D )  ; minimum

the general format:

Name Class Type Data

eeunix IN A 130.111.148.45

IN MX 0 eeunix

IN MX 1 maine.maine.edu.

Trouble Shoot

• Domain cmu.ac.th– ns.cmu.ac.th

• Domain Delegation – eng.cmu.ac.th

• แก้�/เพิ่��ม work ?

• Transfer zone ?