0% found this document useful (0 votes)
6 views70 pages

05 DNS DHCP

The document provides an overview of the Dynamic Host Configuration Protocol (DHCP) and the Domain Name System (DNS). It explains the history, functionality, and importance of DHCP in assigning IP addresses dynamically, along with its advantages and disadvantages. Additionally, it covers the structure and purpose of DNS, including its hierarchical nature and resource record types.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views70 pages

05 DNS DHCP

The document provides an overview of the Dynamic Host Configuration Protocol (DHCP) and the Domain Name System (DNS). It explains the history, functionality, and importance of DHCP in assigning IP addresses dynamically, along with its advantages and disadvantages. Additionally, it covers the structure and purpose of DNS, including its hierarchical nature and resource record types.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 70

Systems & Network Administration

CT106-3-2 (Version VE1)

Chapter 05
Essential Services: Operation and Protocols
DHCP & DNS
Dynamic Host Configuration
Protocol
(DHCP)
History

• DHCP was created by the Dynamic Host


Configuration Working Group of the Internet
Engineering Task Force
• October 1993: RFC 1531 initially defined
DHCP as a standard-track protocol succeeding
the Bootstrap Protocol (BOOTP), which is a
network protocol used by a network client to
obtain an IP address from a configuration
server
• October 1997: RFC 2131 released is the
current DHCP definition for Internet Protocol
version 4 (IPv4) networks
• The extensions of DHCP for IPv6 (DHCPv6)
were published as RFC 3315

Module Code & Module Title Slide Title SLIDE 3


What is DHCP?
• Dynamic Host Configuration Protocol
• It is a method for assigning Internet Protocol (IP)
addresses permanently or to individual computers
in an organization’s network
• DHCP lets a network administrator supervise and
distribute IP addresses from a central point and
automatically sends a new IP address when a
computer is plugged into a different place in the
network

Module Code & Module Title Slide Title SLIDE 4


Motivation for DHCP

• Configuration parameters for network hosts


✓ IP address
✓ Router
✓ Subnet Mask
✓ Others..

Module Code & Module Title Slide Title SLIDE 5


Two types of IP Addresses

• DHCP is used to assign IP addresses to hosts or workstations on


the network
• Two types of IP addresses:
– Static
• Is a number that is assigned to a computer by an Internet service provider (ISP) to be
its permanent address on the Internet
– Dynamic
• The temporary IP address is called a dynamic IP address

Module Code & Module Title Slide Title SLIDE 6


Why is DHCP Important?

• Important when it comes to adding a machine to a network


• When computer requests an address, the administrator would have
to manually configure the machine
✓ Mistakes are easily made
✓ Causes difficulty for both administrator as well as neighbors on the network
• DHCP solves all the hassle of manually adding a machine to a
network

Module Code & Module Title Slide Title SLIDE 7


How does DHCP work?

• When a client needs to start up TCP/IP operations, it broadcasts a


request for address information

• The DHCP server will not reallocate the address during the lease
period and will attempt to return the same address every time the
client requests an address

• The client can extend its lease or send a message to the server
before the lease expires it that it no longer needs the address so it
can be released and assigned to another client on the network

Module Code & Module Title Slide Title SLIDE 8


Advantages and Disadvantages of DHCP

Advantages
• DHCP minimizes the administrative burden
• By using DHCP there is no chance to conflict IP address
• By using DHCP relay agent you provide IP address to another
network
Disadvantages
• When DHCP server is unavailable, client is unable to access
enterprises network
• Your machine name does not change when you get a new IP
address

Module Code & Module Title Slide Title SLIDE 9


Security problem

• DHCP is an unauthenticated protocol


– When connecting to a network, the user is not required to provide
credentials in order to obtain a lease
– Malicious users with physical access to the DHCP-enabled network can
instigate a denial-of-service attack on DHCP servers by requesting many
leases from the server, thereby depleting the number of leases that are
available to other DHCP clients

Module Code & Module Title Slide Title SLIDE 10


Easy to set-up and administer

• DHCP servers are easy to administer and can be set-up in just a few minutes

• Client addresses are assigned automatically

Module Code & Module Title Slide Title SLIDE 11


Limitations

• Some machines on your network need to be at fixed addresses, for example


servers and routers
• You need to be able to assign a machine to run the DHCP server continually as it
must be available at all times when clients need IP access

Module Code & Module Title Slide Title SLIDE 12


Names, Addresses, Routes

Hosts and their services need an identity

These definitions are inevitably mentioned:


o a name identifies what you want, and is generally a text string for human
interpretation;
o an address identifies where it is, and is generally in a machine readable
form;
o a route identifies a way to get there, generally as a list of names or
addresses.
Administrators maintain these

Module Code & Module Title Slide Title SLIDE 13


Dynamic Allocation

At boot, the system knows its MAC address


➢ What is the IP address? Netmask?
➢ What is the route to other hosts?

Static Allocation – host configuration file


• ifconfig
• route add default gw

Dynamic Allocation – configuration server


• need a request/reply protocol
• need a server listening on a TCP/UDP port

Module Code & Module Title Slide Title SLIDE 14


Static Vs. Dynamic Addressing
• Many networks use a combination of static and
dynamic addressing.
– Static addresses for servers, routers, and network management
systems.
– Dynamic addresses for end systems, including workstations and
IP phones.
• The number of end systems
– 30+ use dynamic
• The importance of tracking addresses
– Static provides a consistent audit trail

Module Code & Module Title Slide Title SLIDE 15


Dynamic Host Configuration Protocol (DHCP)

• Centralized administration, superset of BootP


• Servers allocate network layer addresses and save information about
which addresses have been allocated.
• All communication initiated by the client
• Uses UDP on port 68 for client, port 67 for server
– One DHCP session has a common xid ("transaction ID"), randomly selected by the
client

Module Code & Module Title Slide Title SLIDE 16


Dynamic Addressing: DHCP
• Server offers IP address and network parameters for a limited time (called a lease)
• Addresses offered can be
– Fixed addresses allocated to particular computers
– From a pool of reusable IP addresses (supports hosts that are not online all the
time - more hosts than addresses)
• client can renew or relinquish the lease
• address can be requested again when the lease expires
• Lease renewal efforts occur at two intervals: 1/2 of the lease has been used and
7/8 of the lease has been used

Module Code & Module Title Slide Title SLIDE 17


DHCP Client:
Non-DHCP Client:
IP configuration
static IP
from
configuration
DHCP server

IP Address1

IP Address2

DHCP Client: DHCP


IP configuration Database
from DHCP server DHCP IP Address1
Server IP Address2
IP Address3

Module Code & Module Title Slide Title SLIDE 18


The DHCP Lease Process

Module Code & Module Title Slide Title SLIDE 19


DHCP: Messages
1. DHCP client broadcasts a DHCPDISCOVER message to its subnet (255.255.255.255)
– A DHCP relay agent is configured to pass this request to DHCP servers not on the same
physical subnet within the campus or enterprise
2. All DHCP servers that receive a DHCPDISCOVER request may send an DHCPOFFER
– Contains an IP address and possibly other configuration information (subnet mask, DNS
servers, default gateway, etc)
– since a client typically does not need > 1 IP address, more messages needed
3. DHCPREQUEST sent by client to request a certain IP address
– Usually the one sent by an DHCPOFFER
– also used to renew leases and to try to get same address after a reboot
– message is broadcast since a client typically does not need more than one IP address but may
get more than one DHCPOFFER
4. Response by server is DHCPAK or DHCPNAK
ACK: acknowledged, accepted
NACK: something is wrong (for example client requested an IP address it is not supposed to have)
Module Code & Module Title Slide Title SLIDE 20
DHCPREQUEST
Source IP Address = 192.168.0.77
Dest. IP Address = 192.168.0.108
Requested IP Address = 192.168.0.77
Hardware Address = 08004....

DHCPOFFER
Source IP Address = 192.168.0.108
Dest. IP Address = 192.168.0.77
Offered IP Address = 192.168.0.77
Client Hardware Address = 08004...
Subnet Mask = 255.255.255.0
Length of Lease = 8 days
DHCP Client Server Identifier = 192.168.0.108 DHCP Server
DHCP Option: Router = 192.168.0.1

Module Code & Module Title Slide Title SLIDE 21


Using Option Classes

• Vendor-defined Classes Manage DHCP Options Identified by Operating


System Vendor Type
• User-defined Classes Manage DHCP Options with Common
Configuration Requirements

Client1
Configuration A
Client2
DHCP Configuration B Client3
Server

Configuration C

Module Code & Module Title Slide Title SLIDE 22


DHCP Servers in Ubuntu

• Ubuntu makes two DHCP servers available:


– isc-dhcp-server: This server installs dhcpd, the dynamic host configuration
protocol daemon. Although Ubuntu still supports isc-dhcp-server, this software is
no longer supported by its vendor.
– isc-kea: Kea was created by ISC to replace isc-dhcp-server – It is supported in
Ubuntu releases from 23.04 onwards.

Module Code & Module Title Slide Title SLIDE 23


DHCP Servers in Ubuntu
• Install DHCP server

Module Code & Module Title Slide Title SLIDE 24


Summary

Module Code & Module Title Slide Title SLIDE 25


Domain Name System
(DNS)
Purpose of naming

• Addresses are used to locate objects

• Names are easier to remember than numbers

• You would like to get to the address or other objects using a name

• DNS provides a mapping from names to resources of several types

https://www.youtube.com/watch?v=mpQZVYPuDGU
The Complete Guide to Linux System Administration
27
Module Code & Module Title Slide Title SLIDE 27
Naming History

• 1970’s ARPANET
– Host.txt maintained by the SRI-NIC
– pulled from a single machine
– Problems
• traffic and load
• Name collisions
• Consistency
• DNS created in 1983 by Paul Mockapetris
(RFCs 1034 and 1035), modified, updated,
and enhanced by a myriad of subsequent
RFCs

The Complete Guide to Linux System Administration 28


Module Code & Module Title Slide Title SLIDE 28
What is DNS?
• Distributed Directory Service
• Maps names to values – resource records
• Highly resilient to attack*
• Major backbone of the internet
• Makes networks human friendly
• Defined (primarily) in RFC1034 and 1035

*if implemented properly

Module Code & Module Title Slide Title SLIDE 29


TLDs (Top-Level Domains): These are
the highest level of domain names in
the hierarchical structure of the DNS. “root” zone
TLDs are the last segment of a
domain name, appearing after the
final dot. Examples of TLDs include
.com, .org, .net, .gov, .edu, .info, and
many others. com net org au info biz
Other
ccTLDs
TLDs & ccTLDs

two main categories:


• Generic Top-Level Domains (gTLDs): These are
TLDs that are not tied to any specific country or org id com net 2lds
territory. Examples include .com, .org, .net,
.info, .biz, and others.
• Country Code Top-Level Domains (ccTLDs):
These are TLDs that are associated with specific
countries or territories. They are typically two- ausregistry microsoft google yahoo theage 3lds
letter country codes defined by the ISO 3166-1
alpha-2 standard. Examples include .us for the
United States, .uk for the United Kingdom, .de
for Germany, .cn for China, and so on. 4lds
internal prosrs

Module Code & Module Title Slide Title SLIDE 30


•DNS is a hierarchical •A file system is a method and
decentralized naming DNS vs File System data structure used by
system for computers, operating systems to organize
and store files on storage
services, or any resource devices such as hard drives,
connected to the C: SSDs, and network storage.
Internet or a private •It provides a way to organize
network. data into files and directories,
•It translates human- allowing users and
readable domain names applications to create, access,
com au net Program
(like www.example.com) Files
Windows Temp and manage stored
information.
into numerical IP
addresses (like 192.0.2.1)
that computers use to
identify each other on
org com net id Cache System32 Fonts Media
the network.

microsoft google yahoo drivers dllcache spool

Module Code & Module Title Slide Title SLIDE 31


Naming a Domain Naming a Directory

C:
Start
Here

com au net Program


Windows Temp
Files

org com net id Cache System32 Fonts Media

microsoft google yahoo drivers dllcache spool


Start
Here

C:\windows\system32\drivers\
yahoo.com.au.
A “.” is used as A “\” is used as
separator separator

Module Code & Module Title Slide Title SLIDE 32


“root” zone

Other
com net org au info biz
ccTLDs
TLDs & ccTLDs

org id com net 2lds

“zone cuts” or
delegation
points ausregistry microsoft google yahoo theage 3lds

4lds
internal prosrs

Module Code & Module Title Slide Title SLIDE 33


What is a domain?
• A domain is a sub tree of a larger tree identified by a
domain name
• Contains resource records and sub-domains
• Some resource records point to authoritative server for
sub-domains / zones
• eg. the root contains pointers to .au
• google.com.au is a domain

Module Code & Module Title Slide Title SLIDE 34


Other
com net org au info biz
ccTLDs

Domain com.au

org id com net

ausregistry microsoft google yahoo theage

The ausregistry.com.au
internal prosrs sub-domain of com.au

Module Code & Module Title Slide Title SLIDE 35


DNS Resource Record Types

Text name Type Function


Start of authority SOA Defines the zone and zone parameters
Name Server NS Identifies the nameserver for the domain
Address A Converts a hostname to an IPv4 address
Pointer PTR Converts an IPv4 address to a hostname
Canonical Name CNAME Defines another name (alias) for a host
Mail Exchanger MX Where to deliver mail for a domain
Text TXT Arbitrary text strings

Others types are defined, but not commonly used

Module Code & Module Title Slide Title SLIDE 36


DNS Resource Record Types

Module Code & Module Title Slide Title SLIDE 37


What is a resource record?

• A domain contains resource records


• Resource records are analogous to files
• Classified into types
• Some of the important types are SOA, NS, A, CNAME and MX
• Normally defines in “zone files”

Module Code & Module Title Slide Title SLIDE 38


The “A” Record
• The “Address” record
• One or more normally defines a host
• Contains an IPv4 Address (the address computers use to uniquely
identify each other on the internet)
• Eg. The record:
www A 203.18.56.31
In the ausregistry.com.au domain, defines the host uniquely
identifiable as “www.ausregistry.com.au” to be reachable at the IPv4
Address 203.18.56.31

Module Code & Module Title Slide Title SLIDE 39


The “CNAME” Record
• A CNAME defines an alias
• The alias will then be resolved, if another CNAME is encountered then
the process continues until an A record is found
• Eg. The record:
search CNAME www.google.com.
In the ausregistry.com.au domain, defines the name uniquely
identifiable as “search.ausregistry.com.au” to be and alias to
“www.google.com”

Module Code & Module Title Slide Title SLIDE 40


The “MX” Record
• An MX record defines the mail servers for a particular domain
• Mail eXchange records hold the name of hosts, and their priorities, able
to deliver mail for the domain.
• Eg. The record:
ausregistry.com.au MX 10 mail
In the ausregistry.com.au domain, defines the host mail to be the priority
10 mail server for the “ausregistry.com.au” domain

Module Code & Module Title Slide Title SLIDE 41


The “NS” Record
• An NS record defines the authoritative Name servers for the domain.
• The “Name Server” records also define the name servers of children
domains
• Eg. The record:
internal NS ns1.hosting.com.au.
In the ausregistry.com.au domain, defines the host
“ns1.hosting.com.au” to be a name sever for the
“internal.ausregistry.com.au” sub-domain

Module Code & Module Title Slide Title SLIDE 42


What is a Delegation?

• Delegation refers to the act of


putting NS records in a domain
name “delegating” control of a
sub-domain to another entity
• This entity then has the ability
to control the resource records
in this sub-domain and
delegate further children
domains to other entities.
• Eg. IANA delegating control of
a country code domain to the
country.
Module Code & Module Title Slide Title SLIDE 43
What is a zone?

• Its records are held in a database


(“zonefile”) and served from an
authoritative name server
• Zone refers to all the resource
records in a domain but not its sub
domains, the com.au zone contains
delegations records for
ausregistry.com.au, but not the
resource records for
ausregistry.com.au, however all of
these records are part of the com.au
domain
Module Code & Module Title Slide Title SLIDE 44
What is a Name Sever?
Server responsible for answering DNS queries
• Exists at all levels of hierarchy
• Authoritative name servers hold part of the DNS
database
• One name server can serve more then one zone
• Many name servers “should” serve the same zone
• Some name servers are authoritative for certain zones

Module Code & Module Title Slide Title SLIDE 45


Iterative vs Recursive Name Servers
• Serve two very different functions
• Shouldn’t mix the two
• Generally the DNS your computer points to is recursive
• Zones are hosted in iterative name servers
• Iterative servers can only answer information they know or have
cached
• Recursive know how to ask others for information

https://www.youtube.com/watch?v=pkvaTUl5F-Y

Module Code & Module Title Slide Title SLIDE 46


Iterative vs Recursive Name Servers
Aspect Iterative Name Servers Recursive Name Servers
Responds to queries by providing the best answer it Responds to queries by fully resolving the requested domain name
Function can, even if it doesn't have the complete information. by querying other DNS servers if necessary.FQDN

Sends the query to another DNS server if it doesn't Resolves the query internally or by querying other DNS servers
Query Handling have the requested information. until it finds the requested information.
Responsible for providing a quick response and
Responsible for fully resolving the query and providing the client
Responsibility passing responsibility for further resolution to the
with the requested information.
client or another DNS server.

Typically generates less network traffic as it doesn't Can generate more network traffic as it may need to query multiple
Network Traffic perform full resolution internally. DNS servers to fully resolve the query.

Generally simpler as it doesn't need to handle full Can be more complex as it needs to handle full resolution and
Complexity resolution internally. maintain a cache of previously resolved queries.

DNS servers operated by ISPs, large organizations, or internet


Examples Many public DNS servers, like those provided by ISPs.
infrastructure companies.

Suitable for scenarios where quick responses are Essential for resolving less common or newly registered domain
Use Cases prioritized, such as resolving popular domain names. names, ensuring complete resolution.

Module Code & Module Title Slide Title SLIDE 47


Who runs what?
• ICANN/IANA have been granted the power by the US department of commerce
to run the root zone.
• Root ‘zone’ is split into all the ISO ccTLD and some other TLD’s eg. .com, .net,
.info
• Domain name Registries are appointed to operate the “major” zones.
• Each country elects a delegate whom controls their ccTLD eg in Australia the
delegate is auDA.
• Modify TLD and ccTLD resource records on behalf of registrants through a
system of registrars eg. MelbourneIT.

Module Code & Module Title Slide Title SLIDE 48


So what does all this mean to you?

• Domain names make large networks such as the internet human friendly
• IPv4 address difficult to remember and offer no hint as to whom they belong to.
• Problem gets worse when you consider IPv6
• Allow intelligent systems (eg Mail (SMTP)) to preform tasks automatically

Module Code & Module Title Slide Title SLIDE 49


Accessing a web page
• You type http://www.google.com into your web browser and hit enter.

• What happens now?

Module Code & Module Title Slide Title SLIDE 50


Step 1: Your PC sends a resolution request to its
configured DNS Server, typically at your ISP.

Your PC
ISP “Recursive” DNS server

Tell me the Address of


“www.google.com”

Module Code & Module Title Slide Title SLIDE 51


Step 2: Your ISPs recursive name server starts by
asking one of the root servers predefined in its “hints” file.

Tell me the Address of


“www.google.com”

ISP “Recursive” DNS server


Root Servers
I don’t know the address but I know
who’s authoritative for the ”com”
domain ask them

Module Code & Module Title Slide Title SLIDE 52


Step 3: Your ISPs recursive name server then asks
one of the “com” name servers as directed.

Tell me the Address of


“www.google.com”

ISP “Recursive” DNS server


“com” DNS servers

I don’t know the address but I know


who’s authoritative for the
”google.com” domain ask them

Module Code & Module Title Slide Title SLIDE 53


Step 4: Your ISPs recursive name server then asks one
of the “google.com” name servers as directed.

Tell me the Address of


“www.google.com”

ISP “Recursive” DNS server google.com DNS server

The Address of www.google.com is


216.239.53.99

Module Code & Module Title Slide Title SLIDE 54


Step 5: ISP DNS server then send the answer back
to your PC. The DNS server will “remember” the
answer for a period of time.

Your PC
ISP “Recursive” DNS server

The Address of www.google.com is


216.239.53.99

Module Code & Module Title Slide Title SLIDE 55


Step 6: Your PC can then make the actual
HTTP request to the web server.
Send me the www.google.com.au
web page

Your PC
www.google.com web server

Here it is!

Module Code & Module Title Slide Title SLIDE 56


Summary
WEB (HTTP)
Request

“root” DNS servers

google.com.au
Web Server

2
6

1
3
5
Your PC
ISP “Recursive” DNS server “com” DNS servers

4
The actual web
request DNS requests

DNS

google.com DNS server

Module Code & Module Title Slide Title SLIDE 57


Module Code & Module Title Slide Title SLIDE 58
Sending an Email

• DNS is not just used in HTTP protocol (web pages)


• DNS is involved in almost every protocol in use on the internet
• Next example is how DNS facilitates the transfer of electronic mail.

Module Code & Module Title Slide Title SLIDE 59


Step 1: Your PC sends the e-mail to its configured
outbound mail server. A DNS request similar to the
previous example is required to find the address of the
mail server.

Your PC
Outbound Mail (SMTP) Server

Please send this message to


“someone@example.com”

Module Code & Module Title Slide Title SLIDE 60


Step 2: Your mail server follows the same intensive
process to find the authoritative servers for
“example.com”.
Tell me the name servers for
“example.com”

Outbound Mail server


DNS servers

Here are the name servers for


“example.com”

Module Code & Module Title Slide Title SLIDE 61


Step 3: Ask the “example.com” name server for the
list of “Mail eXchangers (MX) for that domain.

Tell me the MX’s for “example.com”

Outbound Mail Server example.com DNS server

The MXs are mx10.example.com


and mx20.backmail.com

Module Code & Module Title Slide Title SLIDE 62


Summary

Module Code & Module Title Slide Title SLIDE 63


Summary

• DNS is integral part in most protocols used on the internet


• Makes the internet human friendly for us all
• Is the world largest distributed database system
• Fits the international model perfectly
• In simple terms is a mapping between names and IP addresses

Module Code & Module Title Slide Title SLIDE 64


Server DNS Configuration in Linux File Structure

Module Code & Module Title Slide Title SLIDE 65


Server DNS Configuration in Linux File Structure

Module Code & Module Title Slide Title SLIDE 66


Server DNS Configuration in Linux File Structure

Module Code & Module Title Slide Title SLIDE 67


Starting DNS in Linux

Module Code & Module Title Slide Title SLIDE 68


Troubleshooting DNS

Module Code & Module Title Slide Title SLIDE 69


Thank you

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy