<div dir="ltr"><div>Hi All</div><div><br></div><div>I found a interesting  issue with /etc/hosts setting in different Linux system.</div><div><br></div><div>My stunnel.conf setting  like below</div><div><br></div><div><span style="white-space:pre">      </span>[HOST]</div><div><span style="white-space:pre">        </span>cert = client.crt</div><div><span style="white-space:pre">     </span>key = client.key</div><div><span style="white-space:pre">      </span>CAfile = server.crt</div><div><span style="white-space:pre">   </span>client = yes</div><div><span style="white-space:pre">  </span>accept = <a href="http://10.160.160.88:57853">10.160.160.88:57853</a></div><div><span style="white-space:pre">   </span>connect = <a href="http://10.136.160.21:3520">10.136.160.21:3520</a></div><div><br></div><div>I would like to connect server <a href="http://10.136.160.21:3520">10.136.160.21:3520</a>  via stunnel  <a href="http://10.160.160.88:57853">10.160.160.88:57853</a></div><div><br></div><div>Part A</div><div><span style="white-space:pre">    </span>If my hostname and  /etc/hosts setting in different System as followings all will works well</div><div><br></div><div><span style="white-space:pre">        </span>1. CentOS 7 32bit </div><div><br></div><div><span style="white-space:pre">          </span>$hostname</div><div><span style="white-space:pre">             </span>localhost.localdomain</div><div><span style="white-space:pre">         </span> $ cat /etc/hosts  </div><div><span style="white-space:pre">         </span>127.0.0.1 localhost localhost4 localhost4.localdomain4</div><div><span style="white-space:pre">                </span>10.136.160.88 localhost.localadmin</div><div><br></div><div><span style="white-space:pre">   </span>2. Redhat 7 64bit</div><div><br></div><div><span style="white-space:pre">            </span>$hostname</div><div><span style="white-space:pre">             </span>localhost.localdomain</div><div><span style="white-space:pre">         </span> $ cat /etc/hosts  </div><div><span style="white-space:pre">         </span>127.0.0.1 localhost  localhost4 localhost4.localdomain4</div><div><span style="white-space:pre">              </span>10.136.160.88 localhost.localadmin</div><div><br></div><div><span style="white-space:pre">   </span>3. Ubuntu15.10 64bit</div><div><span style="white-space:pre">          </span>$hostname</div><div><span style="white-space:pre">             </span>virtual-machine</div><div><span style="white-space:pre">               </span> $ cat /etc/hosts  </div><div><span style="white-space:pre">         </span>127.0.0.1 localhost </div><div><span style="white-space:pre">         </span>10.136.160.88 virtual-machine</div><div>Part B.</div><div><span style="white-space:pre">   </span>If the "127.0.0.1"  include the hostname in /etc/hosts, both CentOS and Fedora will fail,  but Ubuntu still work</div><div><br></div><div><span style="white-space:pre"> </span>1. CentOS 7 32bit </div><div><br></div><div><span style="white-space:pre">          </span>$hostname</div><div><span style="white-space:pre">             </span>localhost.localdomain</div><div><span style="white-space:pre">         </span> $ cat /etc/hosts  </div><div><span style="white-space:pre">         </span>127.0.0.1 localhost<b> localhost.localdomain</b> localhost4 localhost4.localdomain4</div><div><span style="white-space:pre">               </span>10.136.160.253 localhost.localdomain</div><div><br></div><div><span style="white-space:pre"> </span>2. Redhat 7 64bit</div><div><br></div><div><span style="white-space:pre">            </span>$hostname</div><div><span style="white-space:pre">             </span>localhost.localdomain</div><div><span style="white-space:pre">         </span> $ cat /etc/hosts  </div><div><span style="white-space:pre">         </span>127.0.0.1 localhost <b>localhost.localdomain</b> localhost4 localhost4.localdomain4</div><div><span style="white-space:pre">               </span>10.136.160.88 localhost.localadmin</div><div><br></div><div><span style="white-space:pre">   </span>3. Ubuntu15.10 64bit</div><div><span style="white-space:pre">          </span>$hostname</div><div><span style="white-space:pre">             </span>virtual-machine</div><div><span style="white-space:pre">               </span> $ cat /etc/hosts  </div><div><span style="white-space:pre">         </span>127.0.0.1 localhost 

<b style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">virtual-machine</b></div><div><span style="white-space:pre">                </span>10.136.160.88 virtual-machine</div><div><span style="white-space:pre">         </span></div><div>I think it maybe not a stunnel issue, but I'd like to know why it has different behavior </div><div><br></div><div>Thanks</div><div>Jay<span style="white-space:pre">                </span></div><div></div></div>