Eli5: How does DNS or DHCP works.

229 views

My isp or government has blocked access to porn sites but from the same wifi network when I change the dns to Google dns(8.8.8.8) all the blocked sites starts working.

In: 0

5 Answers

Anonymous 0 Comments

Every computer on a network has a unique numerical address called IP address. IP address (version 4 specifically, which is most common today) is represented as a series of four numbers, like [151.101.193.140](https://151.101.193.140).

DNS (Domain Name System) was invented to translate a more human-friendly name like [www.reddit.com](https://www.reddit.com) (the domain name) to the IP address above. It’s often described as like a phone book, a lookup table to translate memorable names into hard-to-remember numbers.

When you type that domain name in your browser, your computer is making requests to one or more DNS servers in series to determine the IP address of the web server you need to talk to. Which DNS server your computer asks first is part of the network configuration of the device.

DHCP (Dynamic Host Configuration Protocol) is a mechanism for a gateway device (eg. a network router) to provide network configuration details to computers that want to connect to it. Usually DHCP is used to assign an IP address to a computer, and the rules by which those IPs will be assigned. But DHCP can also be used to specify a default DNS server that can be used by the connected computers.

Some organisations (schools, companies, ISPs, governments etc) use that mechanism to block certain websites. It’s like handing you a custom phone book where they’ve crossed out the entry for John Smith’s phone number, so if you try calling him you can’t look up what his number is. Or they change the phone number to connect you to a machine that just has a recording that says “Sorry, you’re not allowed to talk to John Smith. Contact your phone company if that’s a problem.” They aren’t blocking the website so much as modifying the DNS records to prevent your computer looking up how to connect to it.

When you specify a custom DNS server on your device, you are overriding the default DNS server configured in the router’s DHCP settings, which is probably set to DNS servers operated by your ISP. You may also just be able to configure DHCP in your router to use a different DNS server, so all devices will use that custom configuration by default instead of having to configure each device separately.

You are viewing 1 out of 5 answers, click here to view all answers.