In: Computer Science
Please explain the differences between DHCP and DNS and discuss their purposes. I'm not looking for an easy google search, I need examples and explanations to help understand the concepts
DHCP(Dynamic Host configuration Protocol) and DNS(Domain Name System) are client - server architecture. DNS maps the name of the domain to the IP address and DHCP is a protocol that assigns the IP address to the host in a network either dynamically or statically.
DHCP was introduced to assign IP address for every device statically por dynamically earlier it was done by network administrators and it was not a pratical approach and takes lot of time. It assigns IP addresses statically or dynamicallly to every connected device in a centralised manner using client server architecture.
DHCP reduces the time-consuming processes of having to configure the systems manually in a network, making everything fast and automatic.
DNS has a namer server where it stores the information about the IP address of each website along with thier name.When user searches a website with thier name DNS resolvers it and obtain the search results. It simply maps a IPaddress to each sites.
DNS eliminates the need to have to remember complicated IP addresses for internet users.
Features
DNS
DNS is resolved for resolving domains by translating the writtern names of domain to the IP addresses.DNS can be used for locating or finding the active directory domain servers.
It works in a decentralised manner and uses the port 53.Eliminates the need to keep in mind or remember all IP addresses.
DHCP
DHCP is used for assigning IP address to the host provides the IP addresses of the router, host, name server, and the subnet mask of the computer. It can provide the address for some time.
DHCP uses port 67 and 68.Very reliable method for assigning IP address and works in a decentralised manner.
Example for DNS(Domain Name System)
Consider an example as Alice is searching for a website address on her browser she types as www.whataday.com. The DNS involves here and convert the hostname (www.whataday.com) to an IPaddress (such as 192.168.1.1).
The When a user wants to load a webpage, a translation must occur between what a user types into their web browser (example.com) and the machine-friendly address necessary to locate the example.com webpage.
In order to understand the process behind DNS resolution there are several process that happens behind apart from initial request by Alice.
There are four DNS servers involved in loading a webpage
DNS recursor: when Alice searches a webpage by typing the website name on browser DNS recursor is a server which recieves this query and responsible for adding additional requests in order to satisfy Alice's DNS query.
Root Name server:The root server is the first step in translating (resolving) human readable host names into IP addresses. I
TLD nameserver : It is the next step in the search for a specific IP address and it hosts the last portion of a hostname (In whataday.com, the TLD server is “com”).
Authorative nameserver:The last step in the nameserver query. If the authoritative name server has access to the requested record, it will return the IP address for the requested hostname back to the DNS Recursor that made the initial request.
Example for DHCP(Dynamic Host Configuration Protocol)
DNCP DISCOVERY Alice is ready to start a computer which is connected to LAN network. the computer checks valid IP configuraion is available or not. If valid confiqration is not available
the device generates a special message known as the DHCPDISCOVER message and broadcasts this message on the local LAN segment.
DHCP Offer:
As the Alices's computer sends the DHCPDISCOVER message to the local broadcast address, if a DHCP server is configured on the local network, it will also receive the message. If multiple DHCP servers are configured on the local network, they all will receive the DHCPDISCOVER message
One of the server send back the DHCOOFFER to the requested device as it does not have the addres of Alice computer it h\just broadcast it. other computer on the network ignores and Alice computer accepts the offer The DHCP offer contains the IP address for the client, the subnet mask of the proposed IP address, the IP address of the default gateway, the DNS domain name, the DNS server address or addresses, and the TFTP server address or addresses.
DHCP Request : After recieving the DHCPOFFER as Alice's computer contain the specific MAC address the Alice 's computer send a DHCP REQUEST
DHCP Acknowledgement: When the DHCP server receives a DHCPREQUEST message from the client, the configuration process enters its final stage. In this stage, the server sends a DHCPACK message to the client.