3

According to my knowledge about IP address and DNS server, when I type facebook.com in the address bar on Chrome and then press the Enter button, with DNS server (E.g: Google DNS server), my browser will redirect to 8.8.8.8 IP address if there is no cache stored in my computer, right? I can ping 8.8.8.8 but I'm unable to view it by typing it in the browser? Why?

10
  • 16
    Because it's a DNS server, not a web page. I'm not quite sure what you're expecting to see; question isn't very clear.
    – Tetsujin
    Mar 3 '20 at 14:43
  • 9
    There are many other types of services on networks beside HTTP/HTTPS.
    – Daniel B
    Mar 3 '20 at 14:52
  • 2
    As already stated - it's a DNS server, it's not a web page, there is nothing you can browse to & look at like a web page… because it isn't one.
    – Tetsujin
    Mar 3 '20 at 15:01
  • 1
    Think of an IP address as an address to a plot of land. The server is an apartment building, and the services (webpage, dns) are apartments. There is no guarantee that any particular plot has a building on it; and when there is, there is no guarantee that any particular apartment has an occupant.
    – Yorik
    Mar 3 '20 at 17:13
  • 1
    "I can ping 8.8.8.8 but I'm unable to view it by typing it in the browser? Why?" - Because web browsers retrieve text files (web pages) which the browser downloads to your PC, then displays to you (along with other resources). In contrast, DNS servers return DNS data that isn't meant for browsers, so there is nothing to (reasonably) display. Mar 4 '20 at 2:12
16

It won't "redirect" anything because 8.8.8.8 is not a website. It is the address of a public DNS server provided by Google.

DNS is the system used to look up addresses.

When you type an address into the bar in Chrome such as www.example.com then your browser contacts a DNS server to find out the IP address of that address. It is this function the 8.8.8.8 provides.

It is a service on the web, but that does not mean it responds in the same way or using the same protocols or ports as a website would. It is a separate server and process from serving websites.

3
  • if the browser won't redirect anything in this case, how we can send a request to the DNS server?
    – logbasex
    Mar 3 '20 at 14:53
  • A browser doesn't do any 'redirecting' of anything. It asks the DNS server where to go to find www.foo.com, DNS returns an IP address to match & your browser connects to that.
    – Tetsujin
    Mar 3 '20 at 15:03
  • @logbasex DNS is a different "channel" than web. Imagine you visit a URL with your browser and the domain has not yet been resolved. Instead of going to a different URL, you pick up the phone and ask someone for the IP address related to that domain, enter it manually in your cache and then your browser can proceed to use that IP instead of the domain. Now replace the phone call and manual adding of the IP address with DNS and your OS network stack.
    – Num Lock
    Mar 4 '20 at 6:56
8

8.8.8.8 is a public IP address, if it's not a webpage, what would it be?

It could be a lot of things.

"Web" isn't exactly the same thing as "internet" – it is just one of many different services that happen to be carried over the internet. Or in other words, the internet's job is to transfer data around between IP addresses, and a website is just one specific kind of data (in a similar way that news broadcasts are just one of many things that can be shown on TV).

Websites are accessed using the HTTP protocol, but you could find many examples of services that run over the internet, but don't use the web nor HTTP (after all, the internet had been in use for a good decade before the web was invented) – DNS is one such service, email is another, and most online games aren't actually web-based either.

Generally, all such protocols have different "port numbers" assigned to them – HTTPS has 443, DNS has 53, and so on. Your browser specifically asks to connect to the server at port 443; the server recognizes it as a protocol that it doesn't provide and rejects the connection entirely before the browser could even begin to send the real request.

(Finally, a system could have an IP address and not offer any service at all – like your computer or phone, which mostly just act as clients and access services hosted elsewhere. However, they still need to have IP addresses in order to transfer anything through the internet at all.)

5

You can't because it's the IP address of Google's DNS server. The port 80 isn't available so you can't access it through a web browser. In fact, there is nothing there to view.

A DNS server is a computer server that contains a database of public IP addresses and their associated hostnames, and in most cases serves to resolve, or translate, those names to IP addresses as requested. DNS servers run special software and communicate with each other using special protocols.

Source: What Is a DNS Server?

4

You can access 8.8.8.8, but it only responds to the right questions.

A DNS server is akin to a telephone book. Pointing your web browser directly at 8.8.8.8 is like smacking the telephone book with the phone handset. You wouldn't expect that to successfully dial, would you? You use the book to look up the right number, then dial that number on the phone - it's a multi-step process.

In the case of web browsing, the lookup process happens behind the scenes. You put a URL into your web browser. Your computer asks the DNS server what IP that name corresponds to, and the DNS server returns the IP. Your computer then uses that IP (without showing it to you) in place of the URL. If you do try to "direct dial" by supplying the IP address in your web browser, the server on the other end has to be expecting a web browser request for a web page (listening to the proper ports for HTTP or HTTPS, configured with a response, etc). Google's DNS servers aren't listening to HTTP/HTTPS requests, just DNS requests.

Keep in mind, there's a lot of other stuff happening behind the scenes on your computer and other computers on the internet when you use a web browser: DNS, routing, load balancing, port forwarding, etc. I've even simplified DNS above - the DNS protocol includes things like distributing data, controlling how long that data is good for, determining the final point of authority, and so on.

3

Your understanding of DNS is incorrect. Your web browser does not redirect to 8.8.8.8, google public dns is only used as a reference to which names/urls match which public ip addresses. Your computer references 8.8.8.8 to find the public IP for 'facebook.com', then caches that information.

3

According to my knowledge about IP address and DNS server, when I type facebook.com in the address bar on Chrome and then press the Enter button, with DNS server (E.g: Google DNS server), my browser will redirect to 8.8.8.8 IP address if there is no cache stored in my computer, right?

Your computer uses DNS to convert a name like facebook.com into an IP address. Computers use IP addresses to talk, so if you provide them names, they need to convert them first.

Redirect is the wrong word here. What your browser will do is this:

If it doesn't already know the IP of facebook.com, or that information is too old, it will ask whatever the DNS server for the IP of "facebook.com". 8.8.8.8 is Google's DNS server (there's many others).

Something you should know:

  • A computer with an IP address can have many programs listening on that same IP at once. That's why there's the concept of a port - if the programs are listening on different ports, they can live on the same IP.

  • Some services have standard ports. DNS uses port 53. HTTP uses port 80. HTTPS uses port 443.

  • You can definitely run a service on a non standard port, but this usually means the client side has to specify the port (the default port is usually the standard one)

So if your browser or OS is set to use 8.8.8.8 as your DNS server, your browser will send a DNS request on port 53 to 8.8.8.8. Browsers and OSes do cache DNS requests so this request is only sent if needed.

Also, you need to keep this in mind:

  • When your browser wants to get a webpage from facebook.com it issues an HTTP request on port 443 to whatever IP is facebook.com, which it learned from the cache or the DNS request it just did.

DNS requests and HTTP/HTTPS requests are different. If something wants a DNS request, you can't give it an HTTP request. And vice versa. It won't understand and will return an error.

I can ping 8.8.8.8 but I'm unable to view it by typing it in the browser? Why?

Because http://8.8.8.8 goes to port 80 by default. https://8.8.8.8 goes to port 443 by default.

It still wouldn't work anyway because again, if a program listening on a port wants a DNS request, it won't know how to process an HTTP request and vice versa..

BUT:

  • There's a thing now called DNS-over-HTTPS (DoH). So your browser can now use HTTPS to issue a DNS request.

  • HTTPS has a certificate security mechanism to ensure you get a warning if it looks like something changed traffic in the middle.

    • This is why certain people want to use it, it prevents ISPs and others from messing with your DNS requests and potentially making you go to the wrong IP address.

    • HTTPS supports a "browser redirect" function - a website can have nothing more but a little bit of information that tells your browser to load another webpage.

    • This is why you can put https://8.8.8.8 in your browser and get a Google DNS page.

    • Note that the new thing here is called DNS over HTTPS but not DNS over HTTP. So this is why if you put http://8.8.8.8 in your browser, nothing will load. Google doesn't have a program even listening on port 80 at 8.8.8.8.

1

There is nothing to see via a browser on that IP-address.

It sounds like, what you are trying to do, is test if your DNS server works, and to do that you can ping a domain like 'google.com'.

If your DNS server is not working, you can still ping 8.8.8.8, but you wont be able to ping the domain.

What you need to do instead, is trying to figure out what you forgot to set up on your DNS.

1

If you send an HTTP request to a DNS server, it will ignore you. It only "listens" to requests to resolve a hostname. (For instance, did you know that superuser.com is at IP-address 151.101.129.69 among others? The DNS sever does!)

1

Webpage(HTML,CSS,JS) is something that gets rendered on the browser when a request is made to a server at port 80 or 443. The server responds with these assets(HTML,CSS,JS) and its the job of the browser to render human readable format on your screen.

A dns server's(8.8.8.8) job is a bit different however, it has to look up the IP address of requested domain and return the static IP address linked with the domain,for this a request with the domain name is sent to this server @port 53(UDP) . For example you can use a tool nslookup using 8.8.8.8(dns server) to check the IP address of the domain google.com.

nslookup google.com 8.8.8.8
>

Server:     8.8.8.8
Address:    8.8.8.8#53

Non-authoritative answer:
Name:   google.com
Address: 172.217.160.142

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.