A question about Localhost with Safari

René J.V. Bertin rjvbertin at gmail.com
Sun Jan 4 09:23:43 PST 2015


On Sunday January 04 2015 10:46:53 Brandon Allbery wrote:

> It'll be fine once commodity Internet and commodity routers/access points
> (aside from Apple's!) includes IPv6 connectivity. Currently, you'll find
> that getting IPv6 upstream is nearly impossible in many places / with many
> providers; most commodity routers don't handle IPv6, or require extra
> configuration to do so, even if you have it (or are only using
> link-local!); and this means you cannot configure IPv6 properly and many
> things can (not necessarily will) fail in weird ways.

Indeed, my LiveBox modem/router doesn't have IPv6 settings

> In this particular case, either Apple is not associating ::1 with the
> loopback adapter in link-local IPv6 mode or Apache is not configuring IPv6
> (and therefore not listening on ::1) if it doesn't find a full IPv6
> configuration; I can't say which. In the one you describe, I'm betting that
> something does not understand IPv6, so when Linux tries to use avahi (its
> version of zeroconf) to connect it fails. (Sadly, Bonjour includes IPv6

Avahi and zeroconf are just configuration-free address resolution protocols. Connecting to a retrieved address goes through the usual TCP/IP stack ;)

> IPv4 zeroconf. I've seen this failure mode myself, and it is one reason my
> stuff is now on a separate network with local IPv6.)

What's weird is that my Mac uses the TimeCapsule's wired hub (the TimeCapsule itself is connected to the main router/modem via ethernet over the mains), so when my Linux box connects to the TC's WiFi it should be on the same "sub sub" network, i.e. communication between it and the Mac should go exclusively over the TimeCapsule. 


> BIND9 at least comes with a local zone definition that includes
> "localhost." as a name, with the usual mapping. That said, people *usually*
> get it from /etc/hosts... *but* OS X is a little weird in how/when it uses
> the hosts file.
> If one believes the contents of /etc/hosts -- OSX only consults it at boot
> time.

I don't think so. I use /etc/hosts for avoiding phoning-home to certain hostnames, for hostname remapping and to add aliases to certain other hosts that have a fixed address. Works as one would expect it, and changes don't require a reboot to take effect. I've also not noticed a difference between command line utilities and "native" applications that presumably use the Foundation API (browsers, notably).

And when I out-comment the localhost definition from /etc/hosts, I can no longer connect to that hostname.
To be exhaustive, my /etc/resolv.conf contains

search orange.fr
nameserver 8.8.8.8
nameserver 192.168.1.1

R.




More information about the macports-users mailing list