Author ssbarnea
Recipients ned.deily, ronaldoussoren, ssbarnea
Date 2018-11-04.16:50:41
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1541350241.71.0.788709270274.issue35164@psf.upfronthosting.co.za>
In-reply-to
Content
It seems that when the MacOS machine does not have a FQDN name manually configured using `scutil`, python will be fail to resolve domain names and timeout after ~30 seconds.

I mention that the DNS resolution works correctly on the machine and that the DHCP servers provides one ore more domains to be useles for resolution. Tools like nslookup or ping are not affected by this, only python (tried py27,34-36 and got same behavior).

Usually python user encounters errors like:

Traceback (most recent call last):
    ...
    socket.gethostbyname(socket.gethostname())
gaierror: [Errno 8] nodename nor servname provided, or not known

One these machines `hostname` cli command returns a valid FQDN name like `foo.lan` but scutil will not return one:
```
sudo scutil --get HostName
HostName: not set
```

One temporary workaround is to manually run:
```
sudo scutil --set HostName `hostname`
```

This will set the hostname and python sockets functions will start to work (after few minutes as some caching is involved).

Still, we cannot expect users to run this command themselves. Even worse, they would have to re-run this each time the roam to another network that may have a different set of domains.

See: https://stackoverflow.com/questions/52602107
History
Date User Action Args
2018-11-04 16:50:41ssbarneasetrecipients: + ssbarnea, ronaldoussoren, ned.deily
2018-11-04 16:50:41ssbarneasetmessageid: <1541350241.71.0.788709270274.issue35164@psf.upfronthosting.co.za>
2018-11-04 16:50:41ssbarnealinkissue35164 messages
2018-11-04 16:50:41ssbarneacreate