Last Updated:

Hosting in IPv6 Only Server

Sagar Devkota Protocols

Hello there, I have been wanting to write on this topic for few months now. Since IPv4 on AWS started charging, I was looking for ways to avoid that charge. With the help of cloudflare  we can host our websites using IPv6 only server that will serve to both IPv6 as well as IPv4 users.

I believe that charging for IPv4 is a good move from AWS, it may push forward for the adaption of IPv6. In this article, we will discuss about IPv4, its limitations why IPv6 was introduced, and how we are still way behind on full adaption of IPv6. and Few Benefits of full adaption of IPv6.

To the Point - Hosting in IPv6 Only Server

If you don't have enough time or looking for straight forward answer, here you go.

If you have IPv6 only server, the server (VPS) that have IPv6 only address, and you are looking for hosting a website, that can be accessible by all the users around the globe you can make use of Cloudflare Proxy, to achieve that.

First Create an account in Cloudflare. Add your Domain, modify the NS on your domain registrar to point to Cloudflare. Import all the DNS records from current DNS manager (to avoid the interruptions).

Now get your ipv6 address, then in Cloudflare DNS management, create an AAAA record. Name should be the subdomain or @ for naked domain. IPv6 address should be the IP from your server. And importantly, remember to enable Proxy (available in Cloudflare DNS). Then save it.

That's all, now any IPv4 / IPv6 users can access the website. To achieve this, Cloudflare under the hood creates two A record and two AAAA records for that domain pointing to their own IP. Whenever they get the http (or https) request they will check the domain name, its original server and proxy the information between the user and the original server.

Configuring your web-server

By now, the request from the users will reach to your server, but you have to configure your server as well. Few things to remember:

  1. Allow incoming request to port 80 (http) and 443 (https)
  2. Configure your webserver to listen to ipv6 requests.

Here is the nginx configuration.

server {
    listen [::]:80;
    root /home/ubuntu/ipv6;
    index index.html;

In the above configuration we listen to port 80 of IPv6 requests. and serve the static website.

I will edit the post and add more details about IPv4 and IPv6.


So here we configured our IPv6 only server to host websites that can be accessible by both IPv4 and IPv6 users. We make use of Cloudflare Proxy, and configure our web server to listen to IPv6 traffics as well, and enable the port 80 and 443 for IPv6 as well.