IPv4 vs IPv6 on VPS: What You Need to Know in 2025

IPv4 vs IPv6 on VPS: What You Need to Know in 2025

Every VPS comes with at least one IPv4 address — the familiar four-number format like 203.0.113.1. Most also come with an IPv6 address — the longer format like 2001:db8::1. Understanding the difference between them, why IPv6 exists, and how to configure both correctly on your VPS saves you headaches when setting up web servers, firewalls, and mail services.

This guide explains the practical differences between IPv4 and IPv6 on a VPS, how to configure a dual-stack setup, common pitfalls, and when having more IPv4 addresses matters.

Why IPv6 Exists: The IPv4 Exhaustion Problem

IPv4 uses 32-bit addresses, providing approximately 4.3 billion unique addresses. That sounds like a lot — until you consider that there are over 20 billion internet-connected devices worldwide. IPv4 addresses ran out globally in 2011.

IPv6 uses 128-bit addresses, providing approximately 340 undecillion unique addresses — enough to assign thousands of unique IPs to every grain of sand on Earth. The transition to IPv6 has been gradual but is accelerating: as of 2025, over 45% of global internet traffic uses IPv6.

IPv4 IPv6
Address format 203.0.113.1 2001:db8:85a3::8a2e:370:7334
Address length 32 bits 128 bits
Total addresses ~4.3 billion ~340 undecillion
NAT required Often (IPv4 exhaustion) No (every device gets unique IP)
Header complexity More complex Simplified (faster routing)
Security IPSec optional IPSec built-in
Adoption (2025) Still dominant ~45% of traffic

What Your VPS IP Setup Looks Like

# Check your current IP configuration
ip addr show

# Example output:
# 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP>
#     inet  203.0.113.1/24    brd 203.0.113.255 scope global eth0
#     inet6 2001:db8::1/64    scope global

Most VPS.DO plans include one IPv4 address and one IPv6 address. The 30IPs plan includes 30 dedicated IPv4 addresses — useful for proxy services, multi-account management, and IP-intensive workloads where having unique US IPs matters.


Configuring Dual-Stack (IPv4 + IPv6) in Nginx

To accept connections on both IPv4 and IPv6, add both listen directives:

server {
    listen 80;           # IPv4
    listen [::]:80;      # IPv6 (brackets required)

    listen 443 ssl;      # IPv4 HTTPS
    listen [::]:443 ssl; # IPv6 HTTPS

    server_name yourdomain.com;
    # ... rest of config
}

The [::]:80 syntax tells Nginx to listen on all IPv6 interfaces on port 80.


DNS Configuration for Dual-Stack

To make your domain reachable via both IPv4 and IPv6, add both record types in your DNS:

Record Type Name Value Purpose
A @ 203.0.113.1 IPv4 address
AAAA @ 2001:db8::1 IPv6 address
A www 203.0.113.1 IPv4 for www
AAAA www 2001:db8::1 IPv6 for www
# Verify both records resolve correctly
dig yourdomain.com A
dig yourdomain.com AAAA

# Test IPv4 connectivity
curl -4 https://yourdomain.com

# Test IPv6 connectivity
curl -6 https://yourdomain.com

Configuring UFW for Both IPv4 and IPv6

sudo nano /etc/default/ufw
# Ensure IPv6 is enabled in UFW
IPV6=yes
# UFW rules apply to both IPv4 and IPv6 automatically
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw allow 2222/tcp  # SSH

sudo ufw reload
sudo ufw status verbose

With IPV6=yes, each UFW rule creates entries for both ip6tables and iptables simultaneously.


IPv6-Specific Firewall Rules with ip6tables

# Block all IPv6 input by default, allow established connections
sudo ip6tables -P INPUT DROP
sudo ip6tables -P FORWARD DROP
sudo ip6tables -P OUTPUT ACCEPT

# Allow loopback
sudo ip6tables -A INPUT -i lo -j ACCEPT

# Allow established connections
sudo ip6tables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT

# ICMPv6 is REQUIRED for IPv6 to function (neighbor discovery, etc.)
sudo ip6tables -A INPUT -p icmpv6 -j ACCEPT

# Allow SSH, HTTP, HTTPS
sudo ip6tables -A INPUT -p tcp --dport 2222 -j ACCEPT
sudo ip6tables -A INPUT -p tcp --dport 80  -j ACCEPT
sudo ip6tables -A INPUT -p tcp --dport 443 -j ACCEPT

# Save rules
sudo ip6tables-save | sudo tee /etc/iptables/rules.v6

⚠️ Important: Never block ICMPv6 completely. It’s required for IPv6 neighbor discovery, router advertisements, and other core functions. Blocking it breaks IPv6 connectivity.


Common IPv6 Issues on VPS

Issue: IPv6 address not persisting after reboot

Add the IPv6 address permanently via Netplan:

sudo nano /etc/netplan/00-installer-config.yaml
network:
  version: 2
  ethernets:
    eth0:
      dhcp4: no
      dhcp6: no
      addresses:
        - 203.0.113.1/24
        - 2001:db8::1/64
      gateway4: 203.0.113.254
      gateway6: 2001:db8::fffe
      nameservers:
        addresses: [1.1.1.1, 2606:4700:4700::1111]
sudo netplan apply

Issue: Applications binding to IPv4 only

Some applications default to IPv4 only. Check with:

sudo ss -tlnp | grep LISTEN

If you see 0.0.0.0:80 but not [::]:80, the app is only listening on IPv4. Fix by updating the app’s bind configuration to :: (all interfaces, both IPv4 and IPv6).

Issue: Mail server IPv6 blacklisting

New IPv6 addresses are often not yet on email reputation databases, causing mail rejection. If you run a mail server, configure it to prefer sending via IPv4 until your IPv6 reputation is established:

# In Postfix main.cf
inet_protocols = ipv4

When More IPv4 Addresses Matter

Despite IPv6’s advantages, IPv4 remains dominant for many commercial applications. Here’s when having multiple IPv4 addresses is genuinely valuable:

Use Case Why Multiple IPv4?
Proxy services Each client gets a dedicated US IP; IPv6 not accepted by many proxy targets
Social media management Platforms associate accounts with IPv4; IPv6 ranges often blocked
Email sending Per-IP reputation; distribute sending volume across IPs
SSL certificates (legacy) Some older setups require one IP per certificate
Gaming servers Console players often connect via IPv4; console IPv6 support is limited

VPS.DO’s USA VPS 30IPs plan provides 30 dedicated US IPv4 addresses on a single 4 vCPU / 8 GB RAM KVM VPS — the most cost-effective way to get a block of US IPs for these use cases.


Checking IPv6 Connectivity

# Test if your VPS can reach IPv6 internet
ping6 ipv6.google.com

# Check your IPv6 address from outside
curl -6 https://ipv6.icanhazip.com

# Test both IPv4 and IPv6 to a site
curl -4 -I https://yourdomain.com
curl -6 -I https://yourdomain.com

# SSL Labs test checks both protocols automatically
# https://www.ssllabs.com/ssltest/analyze.html?d=yourdomain.com

Final Thoughts

For most VPS workloads in 2025, the practical answer is: configure both. Add AAAA records alongside your A records, ensure Nginx listens on both :: and 0.0.0.0, and configure your firewall for both IPv4 and IPv6. This covers all visitors regardless of their ISP’s IP version preference.

For IP-intensive workloads — proxies, email, account management — dedicated IPv4 addresses remain essential, and VPS.DO’s multi-IP plans are built exactly for those use cases.

Fast • Reliable • Affordable VPS - DO It Now!

Get top VPS hosting with VPS.DO’s fast, low-cost plans. Try risk-free with our 7-day no-questions-asked refund and start today!