When you contact a computer across the internet on most home or office networks, you connect using a numeric internet protocol address and a port number. You can look up these numbers in the documentation for the service you're connecting to or discern them from an internet domain name and the standard port number used for a particular type of connection.
Understanding IP Address and Port
Every computer on the internet and most modern home and office networks is assigned an internet protocol, or IP address. These addresses are usually written as sets of four numbers separated by periods, such as 192.0.2.1. Computers use them to route data to the appropriate location, similar to how phone numbers are used to route traditional telephone calls. Some IP addresses are internal to a particular network, while others are accessible to the global internet. It's possible a device can have multiple IP addresses.
When you access a website or other online resource by typing in a domain name such as www.example.com, that address is translated into an IP address using the global Domain Name System. While domain names are useful to humans, computers need IP addresses to get data where it's intended to go.
Many computers run multiple services accessible to the internet and other computers. For example, a web server might host email services as well as webpages, and an office server might offer printing capabilities as well as access to company files.
To route data to the appropriate program offering a desired service, more than just an IP address is required. A number called a port number is used to identify the individual programs running on a machine with a given IP address.
Using an IP and port number routes data to the appropriate program on the appropriate device. The port number doesn't refer to a physical hardware port, only to a number included in internet requests to route data properly.
Find IP Address of Website
If you have the domain name of a website, you can easily determine its IP address using domain name search tools. You can do this with the command line tools nslookup on Microsoft Windows or dig on macOS or Linux, typing the command name followed by a domain name such as example.com. Read the documentation for the tools available on your operating system.
If you prefer not to use the command line, you can find numerous online lookup tools that give you an IP address after you type in a domain. Some also connect to the site to see if it is still live and give you the opportunity to purchase the domain name if it is not currently in use.
Figuring Out Which Port
Most websites are hosted on port 80 if they use the traditional Hypertext Transfer Protocol (HTTP) or on port 443 if the secure version called HTTPS is employed to deliver the website's content. Other digital services have their own standard ports, such as port 25 for the Simple Mail Transfer Protocol (SMTP) used to send email or port 21 for the File Transfer Protocol, commonly known as FTP.
Occasionally you need to use a nonstandard port to connect to a website or another service. You usually are provided with the port number in instructions to connect to a particular server, such as to send email or access a database. In a website address, the port number can be part of the address, such as http://example.com:81 to specify port 81.
You can check which ports are open on a given server using IP port scanner software. However, this action may overload the server or look like an attempt to hack it, so it's usually best only to run such software with permission from the owner of the IP.
- How-To Geek: What Is DNS, and Should I Use Another DNS Server?
- MediaTemple: Understanding the Dig Command
- Intermedia: How Do I Use the NSLOOKUP Tool Provided With Windows?
- GoDaddy: What Is the WHOIS Database?
- MX Toolbox: DNS Lookup
- Mailgun: Which SMTP Port Should I Use? Understanding Ports 25, 465, & 587
- Utilize Windows: List of Common Network Port Numbers