Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Example uses

  • A backend webserver that is called by the world-visible webserver.
  • A static NAT table for the public to use a port number to specify which server they are connecting to.
  • A software that is developed by the company that will not be published, but used in-house.

I was just wondering if there was a standard section of port numbers that should be used. For example when it comes to DNS testing, or non-world-readable domains, there are items in RFC 2606 such as example.com, *.test, etc.

share|improve this question

2 Answers 2

up vote 4 down vote accepted

UDP and TCP ports are assigned by IANA. The ones below 1024 are considered "the well-known ports" and shouldn't be used for anything other than their stated purpose (without good reason). The rest are pretty well fair game: Just let your users know what port to connect to, and keep some documentation for your site.

There is a range that is "unregisterable" (49152–65535) - This is the pool applications are supposed to grab from when they need to open a connection, but it's also available for you to use for whatever purposes you 'd like.

Wikipedia has a page with a prettified version of the port listing. You can also find it in /etc/services on most Unix machines.

share|improve this answer

As far as listening ports on services are concerned, there are the IANA-registered well-known ports, most of which lie below 1024.

Apart from those, you're free to use whatever ports suit you.

A comprehensive list is here: http://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers

In case you want to know, quick-and-dirty, what to use, go to 50000 and over.

Plenty of ports for everybody to go around, after all.

share|improve this answer
1  
Plenty of ports for everybody to go around, after all. -- Didn't they say that about IPv4 addresses? –  voretaq7 Dec 20 '11 at 17:29
    
Don't say we're running out! That's just a guvmint 'spiracy! –  adaptr Dec 20 '11 at 17:53
    
@voretaq7 if you need more ports, just use another IP address. But it's one IP address per device, not one port per device - adding more devices to the internet doesn't consume a port, each device has its own set of ports –  Random832 Dec 20 '11 at 19:02
    
@Random832 Your logic falls apart if I need more than 64K sockets on a single address. It also falls apart in terms of assigned ports (Port numbers are a finite resource, and IANA port assignments, while non-binding, are technically global) –  voretaq7 Dec 20 '11 at 19:10

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.