Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

URLs always have this format:


The problem is that IPv6 uses colons, just like the separator of port and host, e.g:


But what if this is the host, and I want to connect to it with HTTP on port 100?


The problem is the last colon. Since zero's are omitted with double colons (between 1f70 and 999), it's unknown if ':100' belongs to the IP or the port number. How can we know this?

share|improve this question
up vote 84 down vote accepted

The notation in that case is to encode the IPv6 IP number in square brackets:


That's RFC 3986, section 3.2.2: Host

A host identified by an Internet Protocol literal address, version 6 [RFC3513] or later, is distinguished by enclosing the IP literal within square brackets ("[" and "]"). This is the only place where square bracket characters are allowed in the URI syntax. In anticipation of future, as-yet-undefined IP literal address formats, an implementation may use an optional version flag to indicate such a format explicitly rather than rely on heuristic determination.

share|improve this answer
It's worth pointing out that the brackets are not optional. It's the only unambiguous mechanism by which the browser can identify a numeric IPv6 address. – tylerl Nov 25 '10 at 3:58

Your Answer


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.