How to fix DNS Ipv6 error can’t ping on linux
Now let’s dive into the matter.
2. Check and fix IPv6 can’t ping error
Check the network configuration file
Linux usually stores network settings in specific files and reads them for example at startup or when using the ifup command. To change the network configuration, you need to open the correct file in a text editor. In Debian and Ubuntu based distributions, this can be done with
sudo nano /etc/network/interfaces
In most cases, the interfaces file should list at least the following interfaces.
iface eth0 inet6 static Address=<IPv6-IP-Address> pre-up modprobe ipv6 Gateway=<IPv6-IP-Gateway-Address> Scope=link
In CentOS and other Red Hat variants, these configurations are split into separate files for each network interface and stored in /etc/sysconfig/network-scripts/ . The default interface for internet connection is usually called eth0 , open the corresponding configuration file.
The configuration file for eth0 should look like this.
IPV6INIT=yes IPV6ADDR= IPV6_DEFAULTGW=
If the interface configuration files don’t match the examples here, edit your system-specific files to restore original functionality. For any changes made to these files to take effect, you must restart the interface to apply the changes as described previously with the ifdown and ifup commands .
Check the server’s DNS records
When ping with one IP works, but the normal connection still fails, try pinging a domain name instead. For example, you can ping such a domain.
If the domain doesn’t respond, the problem is most likely with the way your server resolves the domain name to an IP address. Check your server’s DNS records.
cat sudo /etc/resolv.conf
The list must contain at least 1 nameserver. All default DNS resolvers at google.com have the same IP address regardless of availability zone. DNS servers are provided automatically by the DHCP protocol and do not require manual configuration in the operating system.
The IPv4 addresses of the google DNS resolver are:
If your server has a public IPv6 address, use IPv6 with the following servers:
If the list is empty, don’t edit it manually, because if you have the nameserver manager installed any changes you make will just be reverted. Instead, on Ubuntu and some Debian systems, you can try updating it with this command.
sudo resolution -u
On servers with no resolution installed , you can edit the resolution file directly .
Add the lines shown below to the file, save and exit.
Then save the file and exit. You will also need to restart the network service with the following command.
service network restart
Debian 8, 9, 10/ Ubuntu
systemctl restart networking
Exit the editor and restart the config file interface you just edited with the ifdown and ifup commands .
Fix DNS Ipv6 error
Our Server Experts do some tweaks in the network configuration file, so that the IPv6 address becomes usable. In other words, we update the following parameters in the file /etc/sysctl.conf
net.ipv6.conf.all.autoconf = 0 net.ipv6.conf.all.accept_ra = 0 net.ipv6.conf.eth0.autoconf = 0 net.ipv6. conf.eth0.accept_ra = 0
Then on save and exit edit . Please type the following command:
After that, verify your configuration by pinging ipv6 enabled site such as ipv6.google.com:
[root@104 network-scripts]# ping6 ipv6.google.com PING ipv6.google.com(lax02s23-in-x0e.1e100.net) 56 data bytes 64 bytes from lax02s23-in-x0e.1e100.net: icmp_seq=1 ttl=59 time=4.64 ms 64 bytes from lax02s23-in-x0e.1e100.net: icmp_seq=2 ttl=59 time=0.352 ms 64 bytes from lax02s23-in-x0e.1e100.net: icmp_seq=3 ttl=59 time=0.356 ms 64 bytes from lax02s23-in-x0e.1e100.net: icmp_seq=4 ttl=59 time=0.382 ms ^C --- ipv6.google.com ping statistics --- 4 packets transmitted, 4 received, 0% packet loss, time 3590ms rtt min/avg/max/mdev = 0.352/1.434/4.649/1.856 ms
Through this article, we have guided you to fix faulty IPv6 DNS. Hope you do it successfully