We can find out IP address of a domain name or URL. But how to find out Port number on which a domain name is hosted?
IP
domain name
URL
Port
domain = self.env['ir.config_parameter'].get_param('web.base.url')
I got the hostname and port number using this.