misc/mc doesn't start if a route is set but not working

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

misc/mc doesn't start if a route is set but not working

Solene Rapenne
Hi

I just wanted to report that misc/mc (midnight commander) won't start if
your network is set, a gateway is set but doesn't have network access
because it wants to resolve the system hostname. If no network is
available, it doesn't try and starts correctly.

tcpdump output when starting mc with network, I modified the dns server to
1.1.1.1 to make it more readable. My system hostname is solene.perso.local

19:13:34.222774 192.168.43.56.4541 > 1.1.1.1.53: 26065+ A? solene.perso.local.(36)
19:13:34.797038 1.1.1.1.53 > 192.168.43.56.4541: 26065 NXDomain 0/1/0(111) [tos 0x50]
19:13:34.797261 192.168.43.56.30463 > 1.1.1.1.53: 11960+ A? solene.perso.local.perso.local.(48)
19:13:34.872702 1.1.1.1.53 > 192.168.43.56.30463: 11960 NXDomain 0/1/0(123) [tos 0x50]
19:13:34.872931 192.168.43.56.27907 > 1.1.1.1.53: 30605+ A? solene.perso.local.(36)
19:13:34.941878 1.1.1.1.53 > 192.168.43.56.27907: 30605 NXDomain 0/1/0(111) [tos 0x50]
19:13:34.943321 192.168.43.56.8533 > 1.1.1.1.53: 15521+ A? solene.perso.local.(36)
19:13:35.019228 1.1.1.1.53 > 192.168.43.56.8533: 15521 NXDomain 0/1/0(111) [tos 0x50]
19:13:35.019476 192.168.43.56.42298 > 1.1.1.1.53: 46078+ A? solene.perso.local.perso.local.(48)
19:13:35.164569 1.1.1.1.53 > 192.168.43.56.42298: 46078 NXDomain 0/1/0(123) [tos 0x50]
19:13:35.164788 192.168.43.56.41654 > 1.1.1.1.53: 42999+ A? solene.perso.local.(36)
19:13:35.289600 1.1.1.1.53 > 192.168.43.56.41654: 42999 NXDomain 0/1/0(111) [tos 0x50]

I have no idea why mc requires this. It looks like more a bug than a feature to
me. It leaks your hostname to your resolver which is a bit weird.

Reply | Threaded
Open this post in threaded view
|

Re: misc/mc doesn't start if a route is set but not working

Kirill Bychkov
On Thu, April 11, 2019 20:17, Solene Rapenne wrote:
> Hi
>
> I just wanted to report that misc/mc (midnight commander) won't start if
> your network is set, a gateway is set but doesn't have network access
> because it wants to resolve the system hostname. If no network is
> available, it doesn't try and starts correctly.

Hi!
I've seen this on OpenBSD and Linux and adding hostname 127.0.0.1 to
/etc/hosts was solving the problem.
It will start anyway but it will take a lot of time if it could not
resolve hostname.

>
> tcpdump output when starting mc with network, I modified the dns server to
> 1.1.1.1 to make it more readable. My system hostname is solene.perso.local
>
> 19:13:34.222774 192.168.43.56.4541 > 1.1.1.1.53: 26065+ A?
> solene.perso.local.(36)
> 19:13:34.797038 1.1.1.1.53 > 192.168.43.56.4541: 26065 NXDomain 0/1/0(111)
> [tos 0x50]
> 19:13:34.797261 192.168.43.56.30463 > 1.1.1.1.53: 11960+ A?
> solene.perso.local.perso.local.(48)
> 19:13:34.872702 1.1.1.1.53 > 192.168.43.56.30463: 11960 NXDomain 0/1/0(123)
> [tos 0x50]
> 19:13:34.872931 192.168.43.56.27907 > 1.1.1.1.53: 30605+ A?
> solene.perso.local.(36)
> 19:13:34.941878 1.1.1.1.53 > 192.168.43.56.27907: 30605 NXDomain 0/1/0(111)
> [tos 0x50]
> 19:13:34.943321 192.168.43.56.8533 > 1.1.1.1.53: 15521+ A?
> solene.perso.local.(36)
> 19:13:35.019228 1.1.1.1.53 > 192.168.43.56.8533: 15521 NXDomain 0/1/0(111)
> [tos 0x50]
> 19:13:35.019476 192.168.43.56.42298 > 1.1.1.1.53: 46078+ A?
> solene.perso.local.perso.local.(48)
> 19:13:35.164569 1.1.1.1.53 > 192.168.43.56.42298: 46078 NXDomain 0/1/0(123)
> [tos 0x50]
> 19:13:35.164788 192.168.43.56.41654 > 1.1.1.1.53: 42999+ A?
> solene.perso.local.(36)
> 19:13:35.289600 1.1.1.1.53 > 192.168.43.56.41654: 42999 NXDomain 0/1/0(111)
> [tos 0x50]
>
> I have no idea why mc requires this. It looks like more a bug than a feature
> to
> me. It leaks your hostname to your resolver which is a bit weird.
>
>


Reply | Threaded
Open this post in threaded view
|

Re: misc/mc doesn't start if a route is set but not working

Solene Rapenne
On Thu, Apr 11, 2019 at 08:59:25PM +0300, Kirill Bychkov wrote:

> On Thu, April 11, 2019 20:17, Solene Rapenne wrote:
> > Hi
> >
> > I just wanted to report that misc/mc (midnight commander) won't start if
> > your network is set, a gateway is set but doesn't have network access
> > because it wants to resolve the system hostname. If no network is
> > available, it doesn't try and starts correctly.
>
> Hi!
> I've seen this on OpenBSD and Linux and adding hostname 127.0.0.1 to
> /etc/hosts was solving the problem.
> It will start anyway but it will take a lot of time if it could not
> resolve hostname.
>

I have already this in my /etc/hosts and it didn't prevent mc being
stuck.

127.0.0.1 localhost solene.perso.local
::1 localhost solene.perso.local

Reply | Threaded
Open this post in threaded view
|

Re: misc/mc doesn't start if a route is set but not working

Jeremie Courreges-Anglas-2
In reply to this post by Solene Rapenne
On Thu, Apr 11 2019, Solene Rapenne <[hidden email]> wrote:

> Hi
>
> I just wanted to report that misc/mc (midnight commander) won't start if
> your network is set, a gateway is set but doesn't have network access
> because it wants to resolve the system hostname. If no network is
> available, it doesn't try and starts correctly.
>
> tcpdump output when starting mc with network, I modified the dns server to
> 1.1.1.1 to make it more readable. My system hostname is solene.perso.local
>
> 19:13:34.222774 192.168.43.56.4541 > 1.1.1.1.53: 26065+ A? solene.perso.local.(36)
> 19:13:34.797038 1.1.1.1.53 > 192.168.43.56.4541: 26065 NXDomain 0/1/0(111) [tos 0x50]
> 19:13:34.797261 192.168.43.56.30463 > 1.1.1.1.53: 11960+ A? solene.perso.local.perso.local.(48)
> 19:13:34.872702 1.1.1.1.53 > 192.168.43.56.30463: 11960 NXDomain 0/1/0(123) [tos 0x50]
> 19:13:34.872931 192.168.43.56.27907 > 1.1.1.1.53: 30605+ A? solene.perso.local.(36)
> 19:13:34.941878 1.1.1.1.53 > 192.168.43.56.27907: 30605 NXDomain 0/1/0(111) [tos 0x50]
> 19:13:34.943321 192.168.43.56.8533 > 1.1.1.1.53: 15521+ A? solene.perso.local.(36)
> 19:13:35.019228 1.1.1.1.53 > 192.168.43.56.8533: 15521 NXDomain 0/1/0(111) [tos 0x50]
> 19:13:35.019476 192.168.43.56.42298 > 1.1.1.1.53: 46078+ A? solene.perso.local.perso.local.(48)
> 19:13:35.164569 1.1.1.1.53 > 192.168.43.56.42298: 46078 NXDomain 0/1/0(123) [tos 0x50]
> 19:13:35.164788 192.168.43.56.41654 > 1.1.1.1.53: 42999+ A? solene.perso.local.(36)
> 19:13:35.289600 1.1.1.1.53 > 192.168.43.56.41654: 42999 NXDomain 0/1/0(111) [tos 0x50]
>
> I have no idea why mc requires this. It looks like more a bug than a feature to
> me. It leaks your hostname to your resolver which is a bit weird.

The asr resolver in libc defaults to "lookup bind file" so DNS is hit
before /etc/hosts.  I have "lookup file bind" in resolv.conf{,.tail}.

--
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE

Reply | Threaded
Open this post in threaded view
|

Re: misc/mc doesn't start if a route is set but not working

Solene Rapenne
On Fri, Apr 12, 2019 at 12:53:28PM +0200, Jeremie Courreges-Anglas wrote:
> On Thu, Apr 11 2019, Solene Rapenne <[hidden email]> wrote:
> > Hi
> >
> The asr resolver in libc defaults to "lookup bind file" so DNS is hit
> before /etc/hosts.  I have "lookup file bind" in resolv.conf{,.tail}.
>

Interesting, I would have think the default order to be "file bind"

About this "issue", someone pointed out to me on IRC this link
https://github.com/MidnightCommander/mc/blob/91a428db5cc5a063bde923c94bf9f7a0a80675ab/doc/FAQ#L701

There is a special case when mc detects /etc/samba/smb.conf and will
try to resolves the hostname only in this case. I had that file, I
renamed it and mc did not try to resolve my hostname.

Reply | Threaded
Open this post in threaded view
|

Re: misc/mc doesn't start if a route is set but not working

Ted Unangst-6
Solene Rapenne wrote:
> > The asr resolver in libc defaults to "lookup bind file" so DNS is hit
> > before /etc/hosts.  I have "lookup file bind" in resolv.conf{,.tail}.
> >
>
> Interesting, I would have think the default order to be "file bind"

The installer will create resolv.conf.tail for you if you select dhcp, so many
people probably get the setting that way.