A
A
AlexGenesis2022-03-08 16:24:43
Domain Name System
AlexGenesis, 2022-03-08 16:24:43

Where is the port being pulled from the DNS server?

I recently made a Python script that, through the standard socket library, accesses the DNS server and requests the ip-address of a site at a given URL, in response from the server I get a white ip-address of the machine on which the site sits, but my question is is how the client finds out on which port of the server the site of interest to him sits, for further connection?
I didn’t find this moment in the specification about DNS (Please indicate it, if it is there), or maybe my understanding is more fundamental and this moment does not concern DNS at all, thank you for the clarification.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
vreitech, 2022-03-08
@AlexGenesis

The site always sits on the same ports: TCP 80 and / or TCP 443. And since the ports are known, there is no need to "pull" them.
If suddenly the site admin decided to hang the site on a different port - then the port is added in the address bar of the browser after the domain name or IP address of the site through a colon.
DNS is not responsible for site ports.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question