SlideShare a Scribd company logo
Overview
• Last Lecture
– Scheduled tasks and log management
• This Lecture
– DNS and BIND
– Reference: DNS and BIND, 4th Edition,
O’Reilly
• Next Lecture
– Address assignment (DHCP)
1
2
Problem
• How to get the IP address with an IP name?
– Mapping between IP addresses and IP names
• Simple solution
– Central database, like /etc/hosts or Sun
Microsystems’ NIS (Network Information
Service) or Windows’ WINS for LAN.
• Domain Name Service (DNS)
– A distributed solution
– BIND is an implementation, an acronym for
Berkeley Internet Name Domain
3
How DNS works?
• Terms: domain name, domain name space,
domain, Fully Qualified Domain Name (FQDN)
• The name space is divided into zones
– At least one server in each zone
– Zones are /(root), net, org, nz
– Can have sub-zones in a zone, e.g. co.nz
• The servers in a zone are responsible for
answering queries about the zone
• Zones are organized hierarchically so that servers
of a zone can be traced from /(root) servers
OSC301 Lecture 11: DNS 4
C
5
DNS client
• The DNS clients use the resolver library
– Resolver is a collection of C functions. The central
routines are gethostbyname and gethostbyaddr
• DNS queries are divided into two kinds
– Recursive: get the final answer of the query
– Iterative: may get redirected to another server
• There are two important files used by those
routines: host.conf and nsswitch.conf
6
DNS client (cont.)
– /etc/host.conf: used by older Linux standard library
libc
• Order: use hosts file, or dns or nis
• Multi: allow to have several IP addresses for a host in /etc/
hosts
• Nospoof: check for spoofing
• Alert: syslog for spoofing
– /etc/nsswitch.conf: used by GNU standard library glibc
• Can specify the order of how to retrieve each info field such as
hosts and networks
• The retrieve methods are dns, nis, files, etc
7
DNS server
• Types of servers
– Primary (master) server: data is stored in
authoritative source files and maintained by
system administrators
– Secondary (slave) server: mirrors the data
in the primary server and downloads its
data second-hand from a primary server at
regular intervals
• The name servers are specified in the
file resolv.conf in a client machine
8
DNS server (cont.)
• To configure a name server, there are several
important files
– /etc/named.conf: specify where to find files for lookups and
reverse lookups at the local domain, where to forward
requests for outside of the domain
– Database files for each local domain and local subnets
• Often under pz or sz, but not required
• Get a template to create them
– named.cache or named.root
• Contains the names of root servers
• The name server needs them when a request is out of its
knowledge
• To start up name server simply type
– /usr/sbin/named
9
Resource record
• Resource record format for named server
– Domain [ttl] [class] type data
– Domain: to which domain this entry applies
– ttl: force resolvers to discard info after a certain time
– Class: IN for IP addresses (Internet), other classes like Hesiod is
mostly confined to MIT)
– Record type: A, AAAA, SOA, PTR, NS, and MX
– Data: depends on type
• Best practices
– Set proper ttl field for RR
– Create PTR records (reverse mapping records) for verifying IP
addresses with IP names
10
RR types
• Types of records in DNS database
– SOA: indicates the start of authority for this domain
– NS: lists a name server for this domain or sub-domain
– MX: lists a mail exchanger for this domain with
priority
– A: defines the canonical name of a host with a given IP
address; AAAA for IPv6
– CNAME: associates an alias with a canonical name
– PTR: for reverse lookup (IP address to name)
– HINFO: advertises host info, CPU and OS
– TXT: description
– rndc: talk with named through a TCP connection
11
Advanced features
• Caching makes DNS more efficient
– Store what the server has learnt
– TTL is important parameter for caching
• Delegation of sub-domains
– Forward requests to servers in sub-domains
– Needs to specify a server for each sub-domain
– The delegated sub-domain is called a zone in the
domain. The domain itself is a zone as well.
• Forwarders
– Reduce offsite DNS traffic
• Reverse mapping: address to name mapping
• Remote control of name server
your network; use secure DNS
12
Security issues
• DNS cache poisoning
– The attacker sends DNS queries to the victim DNS
server and collects the query of the server
– If the server uses static port for sending query, the
vulnerability can be exploited.
– The attacker causes the victim to send a query. Then it
send a forged answer to the victim, which makes the
forged answer into its cache. Therefore, the cache is
poisoned
– The attacker can take advantage of the poisoned cache
to impersonate a trusted host.
– Solution: don’t allow recursive query outside
11: DNS 13
DNS cache poisoning
http://www.youtube.com/watch?v=1d1tUefYn4U
14
Other DNS cache poisoning
• Request: what are the address records for
subdomain.attacker.example?
• Attacker's response:
– Answer:
• (no response)
• Authority section: attacker.example. 3600 IN NS
ns.kiwi_bank.co.nz.
• Additional section: ns.kiwi_bank.co.nz. IN A w.x.y.z (an IP
address controlled by the attacker)
• A vulnerable server would cache the additional A-record
(IP address) for ns.kiwi_bank.co.nz, allowing the attacker
to resolve queries to the entire kiwi_bank.co.nz domain.
15
Bit-squatting
At Black Hat 2011,Artem Dinaburg introduced
a “bit-squatting” attack against DNS where an
attacker registers new domain names that differ
by one bit from popular ones, in order to collect
traffic intended for those names when bit errors
occur during communications or storage.
DNSSEC has begun to be established as a mechanism
for securing information distributed in DNS records.
The new DANE protocol being developed in the IETF
leverages DNSSEC to enable a domain name owner to
inform relying parties which certificates and certificate
authorities it trusts.
16
Security issues (cont.)
• DNS-SEC: DNS Security Extensions
– origin authentication of DNS data
– data integrity
– authenticated denial of existence
– No confidentiality of data (no encryption)
– No protection against DDoS (Distributed Denial of
Service)
• DNS-TSIG
– Secret Key Transaction Authentication for DNS
17
Other issue
• Should the names be English?
– Internationalised Domain Names (IDNs)
18
Summary
• The general understanding of how DNS
works in a distributed system.
• Recursive and iterative queries
• The impact of the TTL field of a DNS
record

More Related Content

Similar to 2_Chapter 2_DNS.pptx

Lets talk dns
Lets talk dnsLets talk dns
Lets talk dns
Abhinav Mehta
 
Domain Name System (DNS) Fundamentals
Domain Name System (DNS) FundamentalsDomain Name System (DNS) Fundamentals
Domain Name System (DNS) Fundamentals
WebSniffer
 
Presentation on Domain Name System
Presentation on Domain Name SystemPresentation on Domain Name System
Presentation on Domain Name System
Chinmay Joshi
 
Meeting 4 DNS
Meeting 4   DNSMeeting 4   DNS
Meeting 4 DNS
Syaiful Ahdan
 
DNS(In_Linux).pptx
DNS(In_Linux).pptxDNS(In_Linux).pptx
DNS(In_Linux).pptx
ShanmugapriyaSenthil3
 
2 technical-dns-workshop-day1
2 technical-dns-workshop-day12 technical-dns-workshop-day1
2 technical-dns-workshop-day1
DNS Entrepreneurship Center
 
1 technical-dns-workshop-day1
1 technical-dns-workshop-day11 technical-dns-workshop-day1
1 technical-dns-workshop-day1
DNS Entrepreneurship Center
 
Dns
DnsDns
Introduction
IntroductionIntroduction
Introduction
hajafaarukh
 
DNS - Domain Name System
DNS - Domain Name SystemDNS - Domain Name System
DNS - Domain Name System
Peter R. Egli
 
Dns
DnsDns
Dns
DnsDns
CNIT 40: 5: Prevention, protection, and mitigation of DNS service disruption
CNIT 40: 5: Prevention, protection, and mitigation of DNS service disruptionCNIT 40: 5: Prevention, protection, and mitigation of DNS service disruption
CNIT 40: 5: Prevention, protection, and mitigation of DNS service disruption
Sam Bowne
 
Hands-on DNSSEC Deployment
Hands-on DNSSEC DeploymentHands-on DNSSEC Deployment
Hands-on DNSSEC Deployment
Bangladesh Network Operators Group
 
DNS (Domain Name System)
DNS (Domain Name System)DNS (Domain Name System)
DNS (Domain Name System)
Shashidhara Vyakaranal
 

Similar to 2_Chapter 2_DNS.pptx (20)

Lets talk dns
Lets talk dnsLets talk dns
Lets talk dns
 
Chapter 9 names
Chapter 9 namesChapter 9 names
Chapter 9 names
 
slide on DNS
slide on DNSslide on DNS
slide on DNS
 
Domain Name System (DNS) Fundamentals
Domain Name System (DNS) FundamentalsDomain Name System (DNS) Fundamentals
Domain Name System (DNS) Fundamentals
 
Presentation on Domain Name System
Presentation on Domain Name SystemPresentation on Domain Name System
Presentation on Domain Name System
 
Meeting 4 DNS
Meeting 4   DNSMeeting 4   DNS
Meeting 4 DNS
 
DNS(In_Linux).pptx
DNS(In_Linux).pptxDNS(In_Linux).pptx
DNS(In_Linux).pptx
 
2 technical-dns-workshop-day1
2 technical-dns-workshop-day12 technical-dns-workshop-day1
2 technical-dns-workshop-day1
 
Dns ppt
Dns pptDns ppt
Dns ppt
 
1 technical-dns-workshop-day1
1 technical-dns-workshop-day11 technical-dns-workshop-day1
1 technical-dns-workshop-day1
 
Dns
DnsDns
Dns
 
13 dns
13 dns13 dns
13 dns
 
Introduction
IntroductionIntroduction
Introduction
 
DNS - Domain Name System
DNS - Domain Name SystemDNS - Domain Name System
DNS - Domain Name System
 
Dns
DnsDns
Dns
 
Dns
DnsDns
Dns
 
CNIT 40: 5: Prevention, protection, and mitigation of DNS service disruption
CNIT 40: 5: Prevention, protection, and mitigation of DNS service disruptionCNIT 40: 5: Prevention, protection, and mitigation of DNS service disruption
CNIT 40: 5: Prevention, protection, and mitigation of DNS service disruption
 
Hands-on DNSSEC Deployment
Hands-on DNSSEC DeploymentHands-on DNSSEC Deployment
Hands-on DNSSEC Deployment
 
Dns interview
Dns interviewDns interview
Dns interview
 
DNS (Domain Name System)
DNS (Domain Name System)DNS (Domain Name System)
DNS (Domain Name System)
 

More from hoangdinhhanh88

linux-lecture3.ppt
linux-lecture3.pptlinux-lecture3.ppt
linux-lecture3.ppt
hoangdinhhanh88
 
Chapter 9 TCP IP Reference Model.ppt
Chapter 9 TCP IP Reference Model.pptChapter 9 TCP IP Reference Model.ppt
Chapter 9 TCP IP Reference Model.ppt
hoangdinhhanh88
 
RemoteAdmin.pptx
RemoteAdmin.pptxRemoteAdmin.pptx
RemoteAdmin.pptx
hoangdinhhanh88
 
Disks.pptx
Disks.pptxDisks.pptx
Disks.pptx
hoangdinhhanh88
 
Backups.pptx
Backups.pptxBackups.pptx
Backups.pptx
hoangdinhhanh88
 
7_Chapter 7_Email.pptx
7_Chapter 7_Email.pptx7_Chapter 7_Email.pptx
7_Chapter 7_Email.pptx
hoangdinhhanh88
 
3_CHAP~2.PPT
3_CHAP~2.PPT3_CHAP~2.PPT
3_CHAP~2.PPT
hoangdinhhanh88
 
1.khai niem can ban
1.khai niem can ban1.khai niem can ban
1.khai niem can ban
hoangdinhhanh88
 
1 giới thiệu-cài đặt oracle
1 giới thiệu-cài đặt oracle1 giới thiệu-cài đặt oracle
1 giới thiệu-cài đặt oracle
hoangdinhhanh88
 
2 co ban ve sql
2 co ban ve sql2 co ban ve sql
2 co ban ve sql
hoangdinhhanh88
 

More from hoangdinhhanh88 (11)

linux-lecture3.ppt
linux-lecture3.pptlinux-lecture3.ppt
linux-lecture3.ppt
 
Chapter 9 TCP IP Reference Model.ppt
Chapter 9 TCP IP Reference Model.pptChapter 9 TCP IP Reference Model.ppt
Chapter 9 TCP IP Reference Model.ppt
 
RemoteAdmin.pptx
RemoteAdmin.pptxRemoteAdmin.pptx
RemoteAdmin.pptx
 
Disks.pptx
Disks.pptxDisks.pptx
Disks.pptx
 
Backups.pptx
Backups.pptxBackups.pptx
Backups.pptx
 
7_Chapter 7_Email.pptx
7_Chapter 7_Email.pptx7_Chapter 7_Email.pptx
7_Chapter 7_Email.pptx
 
3_CHAP~2.PPT
3_CHAP~2.PPT3_CHAP~2.PPT
3_CHAP~2.PPT
 
1.khai niem can ban
1.khai niem can ban1.khai niem can ban
1.khai niem can ban
 
Dns
DnsDns
Dns
 
1 giới thiệu-cài đặt oracle
1 giới thiệu-cài đặt oracle1 giới thiệu-cài đặt oracle
1 giới thiệu-cài đặt oracle
 
2 co ban ve sql
2 co ban ve sql2 co ban ve sql
2 co ban ve sql
 

Recently uploaded

projectreportnew-170307082323 nnnnnn(1).pdf
projectreportnew-170307082323 nnnnnn(1).pdfprojectreportnew-170307082323 nnnnnn(1).pdf
projectreportnew-170307082323 nnnnnn(1).pdf
farazahmadas6
 
Can AI do good? at 'offtheCanvas' India HCI prelude
Can AI do good? at 'offtheCanvas' India HCI preludeCan AI do good? at 'offtheCanvas' India HCI prelude
Can AI do good? at 'offtheCanvas' India HCI prelude
Alan Dix
 
一比一原版(NCL毕业证书)纽卡斯尔大学毕业证成绩单如何办理
一比一原版(NCL毕业证书)纽卡斯尔大学毕业证成绩单如何办理一比一原版(NCL毕业证书)纽卡斯尔大学毕业证成绩单如何办理
一比一原版(NCL毕业证书)纽卡斯尔大学毕业证成绩单如何办理
7sd8fier
 
一比一原版(CITY毕业证书)谢菲尔德哈勒姆大学毕业证如何办理
一比一原版(CITY毕业证书)谢菲尔德哈勒姆大学毕业证如何办理一比一原版(CITY毕业证书)谢菲尔德哈勒姆大学毕业证如何办理
一比一原版(CITY毕业证书)谢菲尔德哈勒姆大学毕业证如何办理
9a93xvy
 
vernacular architecture in response to climate.pdf
vernacular architecture in response to climate.pdfvernacular architecture in response to climate.pdf
vernacular architecture in response to climate.pdf
PrabhjeetSingh219035
 
Research 20 slides Amelia gavryliuks.pdf
Research 20 slides Amelia gavryliuks.pdfResearch 20 slides Amelia gavryliuks.pdf
Research 20 slides Amelia gavryliuks.pdf
ameli25062005
 
Let's Summon Demons Shirt Let's Summon Demons Shirt
Let's Summon Demons Shirt Let's Summon Demons ShirtLet's Summon Demons Shirt Let's Summon Demons Shirt
Let's Summon Demons Shirt Let's Summon Demons Shirt
TeeFusion
 
一比一原版(UNUK毕业证书)诺丁汉大学毕业证如何办理
一比一原版(UNUK毕业证书)诺丁汉大学毕业证如何办理一比一原版(UNUK毕业证书)诺丁汉大学毕业证如何办理
一比一原版(UNUK毕业证书)诺丁汉大学毕业证如何办理
7sd8fier
 
Between Filth and Fortune- Urban Cattle Foraging Realities by Devi S Nair, An...
Between Filth and Fortune- Urban Cattle Foraging Realities by Devi S Nair, An...Between Filth and Fortune- Urban Cattle Foraging Realities by Devi S Nair, An...
Between Filth and Fortune- Urban Cattle Foraging Realities by Devi S Nair, An...
Mansi Shah
 
一比一原版(UCB毕业证书)伯明翰大学学院毕业证成绩单如何办理
一比一原版(UCB毕业证书)伯明翰大学学院毕业证成绩单如何办理一比一原版(UCB毕业证书)伯明翰大学学院毕业证成绩单如何办理
一比一原版(UCB毕业证书)伯明翰大学学院毕业证成绩单如何办理
h7j5io0
 
Portfolio.pdf
Portfolio.pdfPortfolio.pdf
Portfolio.pdf
garcese
 
一比一原版(Columbia毕业证)哥伦比亚大学毕业证如何办理
一比一原版(Columbia毕业证)哥伦比亚大学毕业证如何办理一比一原版(Columbia毕业证)哥伦比亚大学毕业证如何办理
一比一原版(Columbia毕业证)哥伦比亚大学毕业证如何办理
asuzyq
 
PORTFOLIO FABIANA VILLANI ARCHITECTURE.pdf
PORTFOLIO FABIANA VILLANI ARCHITECTURE.pdfPORTFOLIO FABIANA VILLANI ARCHITECTURE.pdf
PORTFOLIO FABIANA VILLANI ARCHITECTURE.pdf
fabianavillanib
 
Design Thinking Design thinking Design thinking
Design Thinking Design thinking Design thinkingDesign Thinking Design thinking Design thinking
Design Thinking Design thinking Design thinking
cy0krjxt
 
一比一原版(Glasgow毕业证书)格拉斯哥大学毕业证成绩单如何办理
一比一原版(Glasgow毕业证书)格拉斯哥大学毕业证成绩单如何办理一比一原版(Glasgow毕业证书)格拉斯哥大学毕业证成绩单如何办理
一比一原版(Glasgow毕业证书)格拉斯哥大学毕业证成绩单如何办理
n0tivyq
 
一比一原版(RHUL毕业证书)伦敦大学皇家霍洛威学院毕业证如何办理
一比一原版(RHUL毕业证书)伦敦大学皇家霍洛威学院毕业证如何办理一比一原版(RHUL毕业证书)伦敦大学皇家霍洛威学院毕业证如何办理
一比一原版(RHUL毕业证书)伦敦大学皇家霍洛威学院毕业证如何办理
9a93xvy
 
Design Thinking Design thinking Design thinking
Design Thinking Design thinking Design thinkingDesign Thinking Design thinking Design thinking
Design Thinking Design thinking Design thinking
cy0krjxt
 
20 slides of research movie and artists .pdf
20 slides of research movie and artists .pdf20 slides of research movie and artists .pdf
20 slides of research movie and artists .pdf
ameli25062005
 
Design Thinking Design thinking Design thinking
Design Thinking Design thinking Design thinkingDesign Thinking Design thinking Design thinking
Design Thinking Design thinking Design thinking
cy0krjxt
 
Exploring the Future of Smart Garages.pdf
Exploring the Future of Smart Garages.pdfExploring the Future of Smart Garages.pdf
Exploring the Future of Smart Garages.pdf
fastfixgaragedoor
 

Recently uploaded (20)

projectreportnew-170307082323 nnnnnn(1).pdf
projectreportnew-170307082323 nnnnnn(1).pdfprojectreportnew-170307082323 nnnnnn(1).pdf
projectreportnew-170307082323 nnnnnn(1).pdf
 
Can AI do good? at 'offtheCanvas' India HCI prelude
Can AI do good? at 'offtheCanvas' India HCI preludeCan AI do good? at 'offtheCanvas' India HCI prelude
Can AI do good? at 'offtheCanvas' India HCI prelude
 
一比一原版(NCL毕业证书)纽卡斯尔大学毕业证成绩单如何办理
一比一原版(NCL毕业证书)纽卡斯尔大学毕业证成绩单如何办理一比一原版(NCL毕业证书)纽卡斯尔大学毕业证成绩单如何办理
一比一原版(NCL毕业证书)纽卡斯尔大学毕业证成绩单如何办理
 
一比一原版(CITY毕业证书)谢菲尔德哈勒姆大学毕业证如何办理
一比一原版(CITY毕业证书)谢菲尔德哈勒姆大学毕业证如何办理一比一原版(CITY毕业证书)谢菲尔德哈勒姆大学毕业证如何办理
一比一原版(CITY毕业证书)谢菲尔德哈勒姆大学毕业证如何办理
 
vernacular architecture in response to climate.pdf
vernacular architecture in response to climate.pdfvernacular architecture in response to climate.pdf
vernacular architecture in response to climate.pdf
 
Research 20 slides Amelia gavryliuks.pdf
Research 20 slides Amelia gavryliuks.pdfResearch 20 slides Amelia gavryliuks.pdf
Research 20 slides Amelia gavryliuks.pdf
 
Let's Summon Demons Shirt Let's Summon Demons Shirt
Let's Summon Demons Shirt Let's Summon Demons ShirtLet's Summon Demons Shirt Let's Summon Demons Shirt
Let's Summon Demons Shirt Let's Summon Demons Shirt
 
一比一原版(UNUK毕业证书)诺丁汉大学毕业证如何办理
一比一原版(UNUK毕业证书)诺丁汉大学毕业证如何办理一比一原版(UNUK毕业证书)诺丁汉大学毕业证如何办理
一比一原版(UNUK毕业证书)诺丁汉大学毕业证如何办理
 
Between Filth and Fortune- Urban Cattle Foraging Realities by Devi S Nair, An...
Between Filth and Fortune- Urban Cattle Foraging Realities by Devi S Nair, An...Between Filth and Fortune- Urban Cattle Foraging Realities by Devi S Nair, An...
Between Filth and Fortune- Urban Cattle Foraging Realities by Devi S Nair, An...
 
一比一原版(UCB毕业证书)伯明翰大学学院毕业证成绩单如何办理
一比一原版(UCB毕业证书)伯明翰大学学院毕业证成绩单如何办理一比一原版(UCB毕业证书)伯明翰大学学院毕业证成绩单如何办理
一比一原版(UCB毕业证书)伯明翰大学学院毕业证成绩单如何办理
 
Portfolio.pdf
Portfolio.pdfPortfolio.pdf
Portfolio.pdf
 
一比一原版(Columbia毕业证)哥伦比亚大学毕业证如何办理
一比一原版(Columbia毕业证)哥伦比亚大学毕业证如何办理一比一原版(Columbia毕业证)哥伦比亚大学毕业证如何办理
一比一原版(Columbia毕业证)哥伦比亚大学毕业证如何办理
 
PORTFOLIO FABIANA VILLANI ARCHITECTURE.pdf
PORTFOLIO FABIANA VILLANI ARCHITECTURE.pdfPORTFOLIO FABIANA VILLANI ARCHITECTURE.pdf
PORTFOLIO FABIANA VILLANI ARCHITECTURE.pdf
 
Design Thinking Design thinking Design thinking
Design Thinking Design thinking Design thinkingDesign Thinking Design thinking Design thinking
Design Thinking Design thinking Design thinking
 
一比一原版(Glasgow毕业证书)格拉斯哥大学毕业证成绩单如何办理
一比一原版(Glasgow毕业证书)格拉斯哥大学毕业证成绩单如何办理一比一原版(Glasgow毕业证书)格拉斯哥大学毕业证成绩单如何办理
一比一原版(Glasgow毕业证书)格拉斯哥大学毕业证成绩单如何办理
 
一比一原版(RHUL毕业证书)伦敦大学皇家霍洛威学院毕业证如何办理
一比一原版(RHUL毕业证书)伦敦大学皇家霍洛威学院毕业证如何办理一比一原版(RHUL毕业证书)伦敦大学皇家霍洛威学院毕业证如何办理
一比一原版(RHUL毕业证书)伦敦大学皇家霍洛威学院毕业证如何办理
 
Design Thinking Design thinking Design thinking
Design Thinking Design thinking Design thinkingDesign Thinking Design thinking Design thinking
Design Thinking Design thinking Design thinking
 
20 slides of research movie and artists .pdf
20 slides of research movie and artists .pdf20 slides of research movie and artists .pdf
20 slides of research movie and artists .pdf
 
Design Thinking Design thinking Design thinking
Design Thinking Design thinking Design thinkingDesign Thinking Design thinking Design thinking
Design Thinking Design thinking Design thinking
 
Exploring the Future of Smart Garages.pdf
Exploring the Future of Smart Garages.pdfExploring the Future of Smart Garages.pdf
Exploring the Future of Smart Garages.pdf
 

2_Chapter 2_DNS.pptx

  • 1. Overview • Last Lecture – Scheduled tasks and log management • This Lecture – DNS and BIND – Reference: DNS and BIND, 4th Edition, O’Reilly • Next Lecture – Address assignment (DHCP) 1
  • 2. 2 Problem • How to get the IP address with an IP name? – Mapping between IP addresses and IP names • Simple solution – Central database, like /etc/hosts or Sun Microsystems’ NIS (Network Information Service) or Windows’ WINS for LAN. • Domain Name Service (DNS) – A distributed solution – BIND is an implementation, an acronym for Berkeley Internet Name Domain
  • 3. 3 How DNS works? • Terms: domain name, domain name space, domain, Fully Qualified Domain Name (FQDN) • The name space is divided into zones – At least one server in each zone – Zones are /(root), net, org, nz – Can have sub-zones in a zone, e.g. co.nz • The servers in a zone are responsible for answering queries about the zone • Zones are organized hierarchically so that servers of a zone can be traced from /(root) servers
  • 5. 5 DNS client • The DNS clients use the resolver library – Resolver is a collection of C functions. The central routines are gethostbyname and gethostbyaddr • DNS queries are divided into two kinds – Recursive: get the final answer of the query – Iterative: may get redirected to another server • There are two important files used by those routines: host.conf and nsswitch.conf
  • 6. 6 DNS client (cont.) – /etc/host.conf: used by older Linux standard library libc • Order: use hosts file, or dns or nis • Multi: allow to have several IP addresses for a host in /etc/ hosts • Nospoof: check for spoofing • Alert: syslog for spoofing – /etc/nsswitch.conf: used by GNU standard library glibc • Can specify the order of how to retrieve each info field such as hosts and networks • The retrieve methods are dns, nis, files, etc
  • 7. 7 DNS server • Types of servers – Primary (master) server: data is stored in authoritative source files and maintained by system administrators – Secondary (slave) server: mirrors the data in the primary server and downloads its data second-hand from a primary server at regular intervals • The name servers are specified in the file resolv.conf in a client machine
  • 8. 8 DNS server (cont.) • To configure a name server, there are several important files – /etc/named.conf: specify where to find files for lookups and reverse lookups at the local domain, where to forward requests for outside of the domain – Database files for each local domain and local subnets • Often under pz or sz, but not required • Get a template to create them – named.cache or named.root • Contains the names of root servers • The name server needs them when a request is out of its knowledge • To start up name server simply type – /usr/sbin/named
  • 9. 9 Resource record • Resource record format for named server – Domain [ttl] [class] type data – Domain: to which domain this entry applies – ttl: force resolvers to discard info after a certain time – Class: IN for IP addresses (Internet), other classes like Hesiod is mostly confined to MIT) – Record type: A, AAAA, SOA, PTR, NS, and MX – Data: depends on type • Best practices – Set proper ttl field for RR – Create PTR records (reverse mapping records) for verifying IP addresses with IP names
  • 10. 10 RR types • Types of records in DNS database – SOA: indicates the start of authority for this domain – NS: lists a name server for this domain or sub-domain – MX: lists a mail exchanger for this domain with priority – A: defines the canonical name of a host with a given IP address; AAAA for IPv6 – CNAME: associates an alias with a canonical name – PTR: for reverse lookup (IP address to name) – HINFO: advertises host info, CPU and OS – TXT: description
  • 11. – rndc: talk with named through a TCP connection 11 Advanced features • Caching makes DNS more efficient – Store what the server has learnt – TTL is important parameter for caching • Delegation of sub-domains – Forward requests to servers in sub-domains – Needs to specify a server for each sub-domain – The delegated sub-domain is called a zone in the domain. The domain itself is a zone as well. • Forwarders – Reduce offsite DNS traffic • Reverse mapping: address to name mapping • Remote control of name server
  • 12. your network; use secure DNS 12 Security issues • DNS cache poisoning – The attacker sends DNS queries to the victim DNS server and collects the query of the server – If the server uses static port for sending query, the vulnerability can be exploited. – The attacker causes the victim to send a query. Then it send a forged answer to the victim, which makes the forged answer into its cache. Therefore, the cache is poisoned – The attacker can take advantage of the poisoned cache to impersonate a trusted host. – Solution: don’t allow recursive query outside
  • 13. 11: DNS 13 DNS cache poisoning http://www.youtube.com/watch?v=1d1tUefYn4U
  • 14. 14 Other DNS cache poisoning • Request: what are the address records for subdomain.attacker.example? • Attacker's response: – Answer: • (no response) • Authority section: attacker.example. 3600 IN NS ns.kiwi_bank.co.nz. • Additional section: ns.kiwi_bank.co.nz. IN A w.x.y.z (an IP address controlled by the attacker) • A vulnerable server would cache the additional A-record (IP address) for ns.kiwi_bank.co.nz, allowing the attacker to resolve queries to the entire kiwi_bank.co.nz domain.
  • 15. 15 Bit-squatting At Black Hat 2011,Artem Dinaburg introduced a “bit-squatting” attack against DNS where an attacker registers new domain names that differ by one bit from popular ones, in order to collect traffic intended for those names when bit errors occur during communications or storage. DNSSEC has begun to be established as a mechanism for securing information distributed in DNS records. The new DANE protocol being developed in the IETF leverages DNSSEC to enable a domain name owner to inform relying parties which certificates and certificate authorities it trusts.
  • 16. 16 Security issues (cont.) • DNS-SEC: DNS Security Extensions – origin authentication of DNS data – data integrity – authenticated denial of existence – No confidentiality of data (no encryption) – No protection against DDoS (Distributed Denial of Service) • DNS-TSIG – Secret Key Transaction Authentication for DNS
  • 17. 17 Other issue • Should the names be English? – Internationalised Domain Names (IDNs)
  • 18. 18 Summary • The general understanding of how DNS works in a distributed system. • Recursive and iterative queries • The impact of the TTL field of a DNS record