1

I am doing local development and literally in mid use of my site, Chrome stopped responding to my domain (let's call it local.mydomain.com) and will only give ERR_CONNECTION_REFUSED.

It works fine in Safari, Firefox, curl, etc. (macOS 14.1)

I am using my hosts file and have a record in it (that again, works everywhere else):

127.0.0.1 localhost local.mydomain.com

Here's where it gets weird - "http://localhost" works fine, but "http://127.0.0.1" does not work, nor does "http://local.mydomain.com".

Here's what I have tried (now keep in mind that for ALL of these, it works fine in other browsers AND curl on the command line):

  • chrome://net-internals, removed all related domains records and removed HSTS records. Also checked the DNS lookup there and the domains all resolve to 127.0.0.1 properly (although, using 127.0.0.1 directly DOESN'T work - has to be localhost)
  • Flushed OS level dns (sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder)
  • Completely re-installed Chrome (deleted application, removed related data in Application Support folder, etc).
  • Installed Chrome Beta and tried there.
  • Tried running on various ports (80, 3000, 3001, whatever - all works in other browsers, not Chrome)
  • Tried adding certs and running with https (works on other browsers, not Chrome)
  • Rebooted computer
  • Tried in another profile on computer
  • chrome://flags/, toggled any DNS related feature - no difference.
  • Changed IPv6 features to any available setting
  • Changed OS level DNS server to other DNS servers (ie 8.8.8.8)
  • Removed all cache, cookies, storage, etc.
  • Hard reload.
  • Added new domains to my hosts file, ran the server with that domain. Doesn't work in Chrome, works everywhere else.

In all the above cases, it works in all other browsers and in curl, but doesn't work in Chrome. Chrome (or Chrome Beta) always IMMEDIATELY gives ERR_CONNECTION_REFUSED.

3.5 hours I've spent on this so far.

How can localhost work but 127.0.0.1 NOT work but only in Chrome? I've seen the other way around (where localhost doesn't work), but never the actual IP. Even Chrome is saying localhost resolves to 127.0.0.1, but using the IP directly doesn't work. I can't make sense of it.

Update:

I have found that if I comment out the IPv6 local host line (::1 localhost) it fixes it, which led me to try adding the custom domain to that line as well, which did fix the problem.

I would still love to know why though - why Chrome absolutely required an IPv6 specific mapping and ignored the perfectly fine IPv4 mappings available when everything else in the OS was fine with IPv4.

Also note that an almost identical machine with the same version of macOS and Chrome DOES NOT need the IPv6 mapping.

3
  • Why isn't the line 127.0.0.1 local.mydomain.com?
    – Ramhound
    Commented Nov 7, 2023 at 2:50
  • I'm mapping both localhost and local.mydomain.com to 127.0.0.1. If you are mapping multiple domains to the same IP you can list them on the same line (although it isn't mandatory). That part works, based on all the other ways I'm able to remove those domains to that IP.
    – WillyC
    Commented Nov 7, 2023 at 5:09
  • Yes, but it’s not working, try separate lines.
    – Ramhound
    Commented Nov 7, 2023 at 6:22

1 Answer 1

0

I needed to add a new binding of ssl in the iis website binding. Bad product of Microsoft. Why do I have to struggle with guessing how to fix it instead of getting a specific error message? enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .