How to disable IPv4 on your website


This document is IN PRODUCTION.


This article is for you, if you want to only allow IPv6 traffic to
your website or some parts of your website. This article is also for
you if you are running a website on an IPv6 only webserver / VM.


IPv6 only webservers

If you are running an IPv6 only webserver, IPv4 clients cannot reach
you. They will be presented with an error message from the

This is clearly not an expected behaviour and your visitors will
likely be confused.

To solve this problem, you can add a DNS "A" entry for your website
pointing to IPv4 only visitors will then be presented
with the content of that explains to
them that they need IPv6 to visit your website.


If you want to help IPv4 visitors to visit IPv6 only websites, you can
add a DNS A entry pointing to Below is the example
code for the BIND DNS server:

; The first one should already be present IN AAAA your:ipv6:address::

; This one allows visitors to get a hint IN A

Dual Stack Webserver: Disabling IPv4 traffic on (parts of) your website

If you are running a Dual Stack website (reachable by IPv6 and IPv4)
and you want to disable IPv4 traffic, you can redirect the user to

Sample nginx configuration for disabling IPv4 traffic

Assuming that you want to disable

geo $iptype { ipv4;

server {
    location ~* ^/ipv6/work/(login|logout|signup|jobs)/(.*)$ {
       if ($iptype) {
           return 302$scheme://$host$uri;

Checkout our blog entry about nginx/geo detection for more information about the nginx configuration.

Changing / Modifying

If you want to make changes to the website, you can access the source code of it on and submit changes to it.

Updated by Nico Schottelius over 5 years ago · 7 revisions