<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Ipv4 on Chris Titus Tech | Tech Content Creator</title><link>https://christitus.com/tags/ipv4/</link><description>Recent content in Ipv4 on Chris Titus Tech | Tech Content Creator</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><managingEditor>Chris Titus</managingEditor><webMaster>Chris Titus</webMaster><lastBuildDate>Fri, 03 Oct 2025 00:00:00 +0000</lastBuildDate><atom:link href="https://christitus.com/tags/ipv4/index.xml" rel="self" type="application/rss+xml"/><item><title>Prioritize Ipv4 Over Ipv6 Linux</title><link>https://christitus.com/prioritize-ipv4-over-ipv6-linux/</link><pubDate>Fri, 03 Oct 2025 00:00:00 +0000</pubDate><author>Chris Titus</author><guid>https://christitus.com/prioritize-ipv4-over-ipv6-linux/</guid><description>&lt;p&gt;On many Linux systems, IPv6 is prioritized over IPv4 by default. This can lead to connectivity issues if the network or services you are trying to reach are not fully compatible with IPv6. To prioritize IPv4 over IPv6, you can modify the system&amp;rsquo;s address selection policy.&lt;/p&gt;
&lt;h2 id="setting-etcgaiconf"&gt;Setting /etc/gai.conf&lt;/h2&gt;
&lt;p&gt;gai.conf is the best and in my opinion, the ONLY method you should use for pushing ipv4 ahead of ipv6. Most methods online show &lt;code&gt;sysctl&lt;/code&gt; which DISABLES ipv6 and not a recommended way because ipv6 is so integrated in to many networks these days.&lt;/p&gt;
&lt;p&gt;Instead change the following file by editing &lt;code&gt;/etc/gai.conf&lt;/code&gt; and no restart or systemctl restart commands are needed.&lt;/p&gt;
&lt;p&gt;Here is the line to uncomment&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;precedence ::ffff:0:0/96 100
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;That&amp;rsquo;s it! Your system will now using ipv4 when it is availible, but can use ipv6 if it isn&amp;rsquo;t.&lt;/p&gt;
&lt;h2 id="verify-ipv4-priority"&gt;Verify ipv4 priority&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;getent ahosts google.com
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;or simply &lt;code&gt;ping google.com&lt;/code&gt; and you will see that ipv4 is shown instead of a ipv6 address at the top. &lt;code&gt;getent&lt;/code&gt; is a nice way of verifying that it will default back to ipv6 as it will show ipv6 addresses towards the bottom.&lt;/p&gt;</description></item></channel></rss>