Hi All
I found a interesting issue with /etc/hosts setting in different Linux system.
My stunnel.conf setting like below
[HOST] cert = client.crt key = client.key CAfile = server.crt client = yes accept = 10.160.160.88:57853 connect = 10.136.160.21:3520
I would like to connect server 10.136.160.21:3520 via stunnel 10.160.160.88:57853
Part A If my hostname and /etc/hosts setting in different System as followings all will works well
1. CentOS 7 32bit
$hostname localhost.localdomain $ cat /etc/hosts 127.0.0.1 localhost localhost4 localhost4.localdomain4 10.136.160.88 localhost.localadmin
2. Redhat 7 64bit
$hostname localhost.localdomain $ cat /etc/hosts 127.0.0.1 localhost localhost4 localhost4.localdomain4 10.136.160.88 localhost.localadmin
3. Ubuntu15.10 64bit $hostname virtual-machine $ cat /etc/hosts 127.0.0.1 localhost 10.136.160.88 virtual-machine Part B. If the "127.0.0.1" include the hostname in /etc/hosts, both CentOS and Fedora will fail, but Ubuntu still work
1. CentOS 7 32bit
$hostname localhost.localdomain $ cat /etc/hosts 127.0.0.1 localhost* localhost.localdomain* localhost4 localhost4.localdomain4 10.136.160.253 localhost.localdomain
2. Redhat 7 64bit
$hostname localhost.localdomain $ cat /etc/hosts 127.0.0.1 localhost *localhost.localdomain* localhost4 localhost4.localdomain4 10.136.160.88 localhost.localadmin
3. Ubuntu15.10 64bit $hostname virtual-machine $ cat /etc/hosts 127.0.0.1 localhost *virtual-machine* 10.136.160.88 virtual-machine I think it maybe not a stunnel issue, but I'd like to know why it has different behavior
Thanks Jay
On 04/16/2018 10:11 AM, White Little wrote:
Part B. If the "127.0.0.1" include the hostname in /etc/hosts, both CentOS and Fedora will fail, but Ubuntu still work
For sake of completeness: What does the "host:" line in /etc/nsswitch.conf say on those systems, and what's the DNS's reply when you try to look up the respective hostname in it?
Regards,
CentOS and Fedora -> "hosts: files dns" Ubuntu -> "hosts : files mdn4_minimal [NOTFOUND=return]" dns
When I use *Part B* /etc/hosts setting, the connection will try to connect to 127.0.0.1:57835, which gets connection fail due to stunnel is not listening on the lookback interface. But my stunnel.conf actually is 10.136.160.88:57835.
Thanks Jay
2018-04-16 19:35 GMT+08:00 Jochen Bern jochen.bern@binect.de:
On 04/16/2018 10:11 AM, White Little wrote:
Part B. If the "127.0.0.1" include the hostname in /etc/hosts, both CentOS and Fedora will fail, but Ubuntu still work
For sake of completeness: What does the "host:" line in /etc/nsswitch.conf say on those systems, and what's the DNS's reply when you try to look up the respective hostname in it?
Regards,
Jochen Bern Systemingenieur
www.binect.de www.facebook.de/binect
stunnel-users mailing list stunnel-users@stunnel.org https://www.stunnel.org/cgi-bin/mailman/listinfo/stunnel-users