Schroedinger's DNS?? Can't resolve host when adding http.. help!

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 site.com

ping: unknown host 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.

scratchandgame, (edited )

You should deal with problem yourself rather than asking like this. Or forget ping.

fucking anyone disliking, that guy doesn’t even have knowledge what a hostname and a protocol is. They should learn it themselves. Don’t need to ask.

Rustmilian, (edited )
@Rustmilian@lemmy.world avatar

Not related to your problem, but you really should be using https when on the web not http.

Rustmilian, (edited )
@Rustmilian@lemmy.world avatar

Wow, are people inept or something?
Why would you want to use http over https? Trick question, you wouldn’t. Https is clearly the better choice. Http needs to die already.

holgersson,

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, (edited )
@Rustmilian@lemmy.world avatar

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.

createkarma,

site.com isn’t a valid host name, DNS won’t resolve it. DNS does not understand protocol, it’s taking your whole query as the hostname

luthis,

Ah thanks, that’s my problem, it’s me.

linearchaos,
@linearchaos@lemmy.world avatar

ping site.com

Not site.com

  • All
  • Subscribed
  • Moderated
  • Favorites
  • linux@lemmy.ml
  • fightinggames
  • All magazines