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.

My web server (Ubuntu, Nginx) have both IPv4 and IPv6 addresses assigned by the host. For my website, shall I bind it to only an IPv6 address? Is it the standard recommended way? Or, shall I use both IPv4 and IPv6 addresses?

share|improve this question
4  
You are asking the wrong question (to the wrong people) -- Ask yourself "Do I need to be able to access this site from IPv4 clients, IPv6 clients, or both?". The answer to that is also the answer to what addresses your web server needs to be listening on. –  voretaq7 Aug 27 '12 at 2:40
1  
Ordinarily, I'd completely agree with a "get your specs first" answer like that, but in this case, oddly, I don't; I agree with Michael. "v6 only" is still, sadly, vanishingly unlikely to be the requirement (though if it is, this comment is wholly wrong). If it's not, then we're down to "mixed stack" and "v4 only". Even if your users all say "v4 only" is right, at this point, it's wrong; mixed-stack is the way to go for future-proofing, no matter what the current user community says. –  MadHatter May 19 '13 at 6:40

2 Answers 2

up vote 26 down vote accepted

Use both IPv4 and IPv6

You should use both IPv4 and IPv6 addresses.

Nearly everyone on the Internet currently has an IPv4 address, or is behind a NAT of some kind, and can access IPv4 resources.

However, only about 3.8% of the Internet is IPv6 capable, but that number is steadily growing as IPv6 begins to roll out worldwide.

In a very few places, ISPs are providing primarily IPv6 or only IPv6 to residential customers and using carrier grade NAT, NAT64 or other such solutions for IPv4 connectivity. This number is expected to grow as IPv4 address space is finally exhausted. These users will typically have better performance over IPv6.

Since IPv6 is where the Internet is going, having your web site IPv6 enabled now puts you ahead of the game and lets you resolve any problems long before they become serious.

Configure nginx

By default with Linux and nginx, you can bind to both IPv4 and IPv6 at the same time by changing your listen directives to:

listen [::]:80 ipv6only=off;

Or, for SSL sites:

listen [::]:443 ipv6only=off ssl;
share|improve this answer
    
Ok thanks... one more question.. Now I have setup the server... In the DNS recurs, I have to put two records A and AAAA (with the host name @) and pointing to the relavant ips? –  EApubs Aug 27 '12 at 2:59
    
Yes, the A record is for your IPv4 address and the AAAA record is for your IPv6 address. –  Michael Hampton Aug 27 '12 at 2:59
    
Perfect. Thanks a lot for the explanation :) Im new to ipv6 stuff –  EApubs Aug 27 '12 at 3:00

Bind to both!

We had an IIS web site whose code did an internal reference to itself, using the DNS name that the client had used. This process would always fail.

Another symptom was that a browser running locally on the server could not find the web site by the name of the server, only by the IPv4 address. That is, http://192.168.55.139 would work, but http://myhost would fail. Using ping myhost would, by default, return the IPv6 address (ping myhost -4 would return the IPv4 address).

The fix was to open IIS and change the Bindings of the web site to bind to the IPv6 address, as well as the IPv4 address.

enter image description here

share|improve this answer
1  
It's not necessary to obfuscate private addresses. Though, you should also bind to your global IPv6 address so that your site can be reached externally via IPv6. –  Michael Hampton Jun 3 at 17:38
    
The code mentioned was the Winnovative HTML to PDF Converter. –  Glen Little Jun 3 at 17:38

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.