This makes no freakin sense to me, and it’s driving me bonkers. Censored for work purposes obv.

Hosts file:

1.1.1.1 site.com

$ping site.com

PING site.com (1.1.1.1)

^C

$ping http://site.com

ping: unknown host http://site.com

What?? Ping, You JUST RESOLVED site.com, why can’t you resolve it now??

Why does the addition of the protocol break DNS resolution?

It’s CentOS 6.10, quite old…

/etc/nsswitch has:

hosts: files dns

Any pointers would be much appreciated.

  • holgersson
    link
    fedilink
    29 months ago

    It might just be local network traffic or a dev env. Not to mention that https is just unnecessary overhead for some usecases, especially when only GETting data.

    • Rustmilian
      link
      English
      5
      edit-2
      9 months ago

      I literally said when on the web
      Local & loopback doesn’t count as the web.
      The overhead of https is very minor, incredibly trivial and as been for nearly 10y now. Https is essentially the default protocol these days.