How to find Port number of IP address?

2019-03-12 06:41发布

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?

7条回答
乱世女痞
2楼-- · 2019-03-12 07:11
 domain = self.env['ir.config_parameter'].get_param('web.base.url')

I got the hostname and port number using this.

查看更多
成全新的幸福
3楼-- · 2019-03-12 07:19

The port is usually fixed, for DNS it's 53.

查看更多
太酷不给撩
4楼-- · 2019-03-12 07:19

If it is a normal then the port number is always 80 and may be written as http://www.somewhere.com:80 Though you don't need to specify it as :80 is the default of every web browser.

If the site chose to use something else then they are intending to hide from anything not sent by a "friendly" or linked to. Those ones usually show with https and their port number is unknown and decided by their admin.

If you choose to runn a port scanner trying every number nn from say 10000 to 30000 in https://something.somewhere.com:nn Then your isp or their antivirus will probably notice and disconnect you.

查看更多
▲ chillily
5楼-- · 2019-03-12 07:22

Use of the netstat -a command will give you a list of connections to your system/server where you are executing the command.

For example it will display as below, where 35070 is the port number

 TCP    10.144.0.159:**52121**    sd-s-fgh:35070   ESTABLISHED
查看更多
做自己的国王
6楼-- · 2019-03-12 07:23

Port numbers are defined by convention. HTTP servers generally listen on port 80, ssh servers listen on 22. But there are no requirements that they do.

查看更多
一纸荒年 Trace。
7楼-- · 2019-03-12 07:30

DNS server usually have a standard of ports used. But if it's different, you could try nmap and do a port scan like so:

> nmap 127.0.0.1
查看更多
登录 后发表回答