N
N
nano_e_t_42019-10-02 16:40:28
linux
nano_e_t_4, 2019-10-02 16:40:28

How does a browser resolve a domain?

Hello everyone The
question is a bit unusual, but it became very interesting - how does the browser resolve the domain?
that is, when a string was entered in the browser, for example http://domain.com, he needs to distribute it, to understand that this is a domain request and not a search string. It then needs to determine the protocol, and the browser checks the list of hsts to understand http or https. After defining the protocol, he needs to resolve the domain, and he calls the getHostByName function and passes the domain name as an argument
According to the Internet, the browser logic is divided into certain components, each of which performs its own set of actions. I think that the browser parses the incoming request in a class that somehow relates to the component, the browser engine, and the hsts list lies somewhere in the class that relates to the storage logic. But the domain resolution (and, apparently, working with the operating system in general) is not entirely clear in which component it happens.
If anyone knows and tells, I will be very grateful
ps
Exceptional curiosity

Answer the question

In order to leave comments, you need to log in

4 answer(s)
D
Dimonchik, 2019-10-02
@dimonchik2013

browser checked hsts list
there are facts?
they already wrote about the resolve: in fact, the domain perfectly falls under regxp, you don’t even need to keep the list: localhost or my.dev will open

C
CityCat4, 2019-10-02
@CityCat4

Ok, Google
OSI Model
What is DNS fall

V
Vitaly Karasik, 2019-10-02
@vitaly_il1

Here are the details https://habr.com/ru/company/htmlacademy/blog/254825/, except that they didn’t write about electrons :-)

D
Dmitry, 2019-10-10
@dlnsk

Are you interested in browser architecture? Well, apparently, it is different in everyone...
The answer to all your "I think" and "somewhere" in the source:
https://github.com/chromium/chromium

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question