Also available in
Updated November 23, 2026. If your DMIT VPS can reach an AI API over IPv4 but keeps timing out over IPv6, check the network connection before changing any settings. This guide shows how to disable IPv6 on Ubuntu or Debian using sysctl, test both routes with curl, and restore IPv6 if the change doesn’t help.
The problem isn’t limited to DMIT. A Linux VPS can have a perfectly working internet connection while requests to ChatGPT, Claude, Grok, Gemini, or other services still fail. DNS, IPv6 routing, firewall rules, IP reputation and service-side restrictions can all play a part.
Before turning off IPv6, we’ll check whether the server actually has a working IPv6 connection and whether the affected service behaves differently over IPv4. That way, you won’t end up changing your VPS network settings without knowing what caused the problem.
Important: Disabling IPv6 is a troubleshooting option, not a universal fix for AI service connection errors. It won’t resolve incorrect API credentials, rate limits, account restrictions or a service’s geographic availability rules.
Why IPv6 Can Cause Connection Problems on a VPS
Many VPS providers, including DMIT, support dual-stack networking. This means a server can have both IPv4 and IPv6 connectivity.
When an application connects to a domain, DNS may return two different address records:
- A record: Contains an IPv4 address.
- AAAA record: Contains an IPv6 address.
If both records exist, the operating system or application decides which address to use. Some clients use mechanisms such as Happy Eyeballs to avoid getting stuck on an unreachable connection.
However, IPv4 and IPv6 don’t necessarily follow the same route to the destination. They also use different public IP addresses, which can affect how a remote service identifies the connection.
For example, a DMIT VPS might reach an AI API normally over IPv4 while its IPv6 connection times out. The cause could be an IPv6 routing problem, a firewall rule, missing connectivity at the destination, or a difference in how the remote service handles the request.
It’s also important to distinguish a network failure from an HTTP error.
- Connection timeout: The client couldn’t complete the connection within the configured time.
- HTTP 403: The server received the request but refused it.
- HTTP 429: The service is reporting too many requests or another usage-related limit.
These situations need different checks. An HTTP 403 response doesn’t automatically mean an IPv6 address has been blocked, and disabling IPv6 won’t increase an API account’s rate limit.
Check IPv4 and IPv6 Connectivity on Your VPS
Before making any changes, connect to your Ubuntu or Debian VPS over SSH and test both IP families separately.
The commands below use curl, which is available on most Linux server installations. If curl isn’t installed, install it using your distribution’s package manager first.
1. Check Your Public IPv6 Address
Run:
curl -6 --connect-timeout 10 ifconfig.co
The -6 option forces curl to use IPv6.
If your VPS has working IPv6 connectivity to this service, the command should return a public IPv6 address similar to:
2xxx:xxxx:xxxx::xxxx
This tells you that the VPS can reach the IP-check service over IPv6. It does not prove that every website or API is reachable through IPv6.
If the request fails, the VPS may not have working IPv6 connectivity, or the destination may not be accessible over IPv6. You’ll need additional tests to identify the cause.
2. Check Your Public IPv4 Address
Next, run:
curl -4 --connect-timeout 10 ifconfig.co
The -4 option forces IPv4.
If the request succeeds, curl should return the public IPv4 address used by your VPS.
When both commands return addresses, your server can reach this particular destination over IPv4 and IPv6.
That doesn’t mean your applications will always use the same IP family. Their behavior depends on DNS results, address-selection rules and application settings.
3. Compare IPv4 and IPv6 Connections to the Same Service
Checking your public IP address is useful, but the next test is more important: compare IPv4 and IPv6 connections to the service that’s actually failing.
Run:
curl -4 -I --connect-timeout 10 https://example.com
curl -6 -I --connect-timeout 10 https://example.com
Replace https://example.com with the hostname you want to test. Use a website or API endpoint you’re authorized to access.
In these commands, -4 selects IPv4, -6 selects IPv6, and -I requests HTTP response headers using a HEAD request.
Some APIs require authentication or don’t support HEAD requests. They may return HTTP 401 or 405 even when the network connection is working. For those services, use the documented API request instead.
Here’s how to interpret the most common results:
| Result | What It Means | Next Step |
|---|---|---|
| IPv4 and IPv6 both connect | Both connections reach the destination. | Check the HTTP response, API request and application logs. |
| IPv4 works, IPv6 times out | The failure may be related to IPv6 connectivity or routing. | Check IPv6 DNS, routes and firewall rules. |
| IPv6 works, IPv4 fails | The IPv4 connection has a separate problem. | Check IPv4 routing, firewall rules and the public IP. |
| Both connections fail | The problem may affect the destination or general connectivity. | Check DNS, proxy settings, ports and service status. |
| HTTP 403 | The remote service rejected the HTTP request. | Inspect the response and the service’s access requirements. |
| HTTP 429 | The service reports a request or usage limit. | Review the provider’s rate-limit documentation. |
Keep in mind that a hostname without an AAAA record may fail a forced IPv6 request even if your VPS has perfectly working IPv6 connectivity.
If IPv4 works consistently while IPv6 fails for the same destination, testing an IPv4-only configuration may help narrow down the problem.
How to Disable IPv6 on Ubuntu or Debian VPS
On Ubuntu and Debian, you can disable IPv6 using Linux sysctl settings. The same kernel parameters are available on many other distributions, including AlmaLinux, although their network-management configurations may differ.
We’ll create a separate configuration file under /etc/sysctl.d/. This makes the change easier to identify and reverse later.
Before proceeding, confirm that you can access your VPS through its IPv4 address. If your current SSH session uses IPv6, disabling it can disconnect you immediately.
Also check whether any applications depend on IPv6. Docker containers, reverse proxies, databases, monitoring agents and services listening on ::1 may be affected by a host-level change.
Step 1. Create an IPv6 sysctl Configuration File
Open your terminal and run:
sudo nano /etc/sysctl.d/99-disable-ipv6.conf
Add the following lines:
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
Here’s what these settings do:
net.ipv6.conf.all.disable_ipv6 = 1disables IPv6 operation on the host’s network interfaces.net.ipv6.conf.default.disable_ipv6 = 1sets the default for interfaces created later.net.ipv6.conf.lo.disable_ipv6 = 1explicitly disables IPv6 on the loopback interface, including::1.
The loopback setting deserves extra attention. Some applications communicate locally over ::1. If your VPS runs software that depends on IPv6 loopback, don’t disable it without checking those dependencies first.
To save the file in nano, press Ctrl + O, press Enter to confirm the filename, then press Ctrl + X to exit.
Step 2. Apply the New IPv6 Settings
Load the system’s sysctl configuration files:
sudo sysctl --system
This reads sysctl configuration from the standard system locations, including the file you just created.
Check the terminal output for errors or conflicting values. Since --system reloads other sysctl settings as well, changes elsewhere in the configuration may also be applied.
On most Linux VPS installations, the IPv6 settings take effect without a reboot.
Any active IPv6 connections may be interrupted immediately.
Step 3. Verify That IPv6 Is Disabled
Check the three parameters:
sysctl net.ipv6.conf.all.disable_ipv6
sysctl net.ipv6.conf.default.disable_ipv6
sysctl net.ipv6.conf.lo.disable_ipv6
The expected output is:
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
A value of 1 means the corresponding IPv6 disable setting is active.
Now repeat the IPv6 connectivity test:
curl -6 --connect-timeout 10 ifconfig.co
With IPv6 disabled on the host, this command should no longer establish a normal IPv6 connection.
Check IPv4 as well:
curl -4 --connect-timeout 10 ifconfig.co
If IPv4 still works, repeat the request that originally failed.
This final comparison is more useful than checking the public IP address alone. What matters is whether your original website or API request behaves differently after the change.
Test AI API Access After Disabling IPv6
Once your DMIT VPS is using IPv4 for normal outbound connections, return to the website or API that was failing earlier.
For a public website, start with a simple connectivity test:
curl -4 -I --connect-timeout 10 https://example.com
Replace the example URL with the destination you’re troubleshooting.
For an API, use a valid request from the provider’s documentation. Don’t include API keys or private credentials in screenshots, logs or public troubleshooting posts.
Compare the new result with the tests you ran before disabling IPv6:
- Does the connection complete instead of timing out?
- Does the server return an HTTP response?
- Does the actual application request succeed?
If the request previously worked only with curl -4 and now works without forcing IPv4, that suggests IP-family selection or IPv6 connectivity played a role.
However, it doesn’t prove that the IPv6 address was blocked. A routing issue, firewall rule, application setting or destination-side network problem may explain the difference.
If you still receive HTTP 403, check the service’s access policy and error response. If you receive HTTP 429, check rate limits and usage restrictions.
For example, disabling IPv6 cannot make an unavailable API region officially supported, and it cannot fix an account that has exceeded its request quota.
The screenshot below shows an earlier Grok connectivity test after changing the VPS IPv6 settings. It’s included as an example of the testing process, not a guarantee of current access from every DMIT location.
How to Re-Enable IPv6 on Ubuntu or Debian
If disabling IPv6 doesn’t fix the problem, or another service needs IPv6, you can restore the original configuration.
First, remove the configuration file created earlier:
sudo rm /etc/sysctl.d/99-disable-ipv6.conf
This removes the persistent configuration, but it doesn’t automatically restore the settings already active in the running kernel.
Set the three parameters back to 0:
sudo sysctl -w net.ipv6.conf.all.disable_ipv6=0
sudo sysctl -w net.ipv6.conf.default.disable_ipv6=0
sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=0
A value of 0 allows IPv6 operation again on the corresponding interfaces.
Next, check whether the VPS has an IPv6 address:
ip -6 addr
Then test external connectivity:
curl -6 --connect-timeout 10 ifconfig.co
Re-enabling IPv6 in the kernel doesn’t always restore a public IPv6 address immediately. The network manager, cloud-init settings or hosting provider’s network configuration may need to reinitialize the interface.
If the address is still missing, review your VPS network configuration. On a server where rebooting is safe and you have console access, a restart may help:
sudo reboot
Make sure you’ve removed the 99-disable-ipv6.conf file before rebooting. Otherwise, the same configuration may disable IPv6 again when the server starts.
After reconnecting over SSH, run:
ip -6 addr
curl -6 --connect-timeout 10 ifconfig.co
If IPv6 still doesn’t work, check for other sysctl rules, boot-time IPv6 settings, missing routes or network-interface configuration problems.
Should You Keep IPv6 Disabled on a VPS?
Usually, there’s no reason to turn off IPv6 on a server where both IPv4 and IPv6 are working correctly.
Keeping IPv6 enabled may be useful for dual-stack websites, monitoring tools, application networks and services that accept IPv6-only clients.
Turning it off at the host level can also have side effects:
- Reverse proxies listening on IPv6 addresses may stop accepting connections.
- Applications using the IPv6 loopback address
::1may fail. - Docker containers and published ports may behave differently depending on their network configuration.
- Monitoring systems may report failures if they expect an IPv6 endpoint.
If only one application has trouble over IPv6, check whether that application can be configured to use IPv4 rather than changing networking for the entire VPS.
For example, the curl options used in this guide let you choose IPv4 or IPv6 for an individual request:
curl -4 https://example.com
curl -6 https://example.com
These commands don’t change the global network configuration.
Disabling IPv6 makes the most sense as a controlled troubleshooting step when you’ve confirmed that the same destination works over IPv4 but repeatedly fails over IPv6.
Frequently Asked Questions
How do I disable IPv6 on Ubuntu permanently?
Create a configuration file under /etc/sysctl.d/ containing the appropriate net.ipv6.conf.*.disable_ipv6 settings, then apply it using sudo sysctl --system. The configuration is intended to persist across reboots, provided another network or boot-time setting doesn’t override it.
Can I use the same commands to disable IPv6 on Debian?
Yes. Ubuntu and Debian use the same Linux kernel sysctl parameters. The commands also work on many other Linux distributions, although network-management and boot configurations can differ.
Does DMIT VPS support IPv6?
Yes. DMIT’s documentation describes IPv6 allocation for its VPS instances, including a default /64 prefix. However, having an IPv6 allocation doesn’t guarantee that the operating system has working IPv6 routing. Check the interface configuration and test the connection from the server.
Why does curl -4 work while curl -6 fails?
The two commands use different IP families. A failure with curl -6 may be caused by missing IPv6 DNS records, an unreachable IPv6 route, firewall restrictions or a destination that doesn’t support IPv6. Compare the errors and test another known IPv6-enabled destination before drawing a conclusion.
Will disabling IPv6 fix ChatGPT, Claude or Grok connection errors?
It may help if the failure is specifically related to IPv6 routing or address selection. It won’t fix invalid API credentials, account restrictions, exceeded usage limits or geographic service restrictions.
Does HTTP 403 mean my IPv6 address is blocked?
No. HTTP 403 means the remote service rejected the request at the HTTP level. The reason may involve authentication, permissions, geographic availability or other access policies. Check the provider’s error response rather than assuming IPv6 is responsible.
What does HTTP 429 mean when calling an AI API?
HTTP 429 commonly indicates a rate limit or another usage-related restriction. Check the specific error response, API quota and retry guidance. Disabling IPv6 won’t increase the limits assigned to your account.
Can disabling IPv6 break Docker containers?
It can affect container networking, depending on your Docker configuration, network namespaces and published ports. A host-level sysctl change should not be assumed to update every container’s separate networking settings. Check any services that depend on IPv6 before proceeding.
How do I turn IPv6 back on after using sysctl?
Remove the configuration file you created, set the relevant disable_ipv6 values back to 0, and check the server’s IPv6 addresses and routes. Some systems may require network reinitialization or a reboot to recover their original IPv6 configuration.
DMIT VPS Network Tools and References
If your DMIT VPS still has connection problems after testing IPv4 and IPv6, check the instance’s public IP allocation, network configuration and routing information in your hosting account.
You can also compare curl results with the application’s error logs before contacting support. Include the destination hostname, the failed IP family and the relevant connection error, but avoid sharing API keys or other credentials.
DMIT Official Website — VPS Plans and Account Management
Useful technical references:
- DMIT Documentation — IP Addresses and IPv6 Allocation
- Linux Kernel Documentation — IP Sysctl Settings
- Linux sysctl Manual Page
- curl Manual — IPv4, IPv6 and Connection Options
- OpenAI API Documentation — Error Codes
Last reviewed: November 23, 2026. This guide covers host-level IPv6 troubleshooting on Linux VPS servers. Results depend on the operating system, network configuration, application and hosting provider. Make sure you have working IPv4 SSH access or console access before changing network settings.
Affiliate disclosure: This article contains a DMIT affiliate link. We may earn a commission if you purchase through it. This does not affect the troubleshooting steps or technical recommendations in this guide.








Comments (0)