Level 0.99 question(s) about networking

so im playing with my host file…
and i see

0.0.0.0 localhost
127.0.0.1 localhost

in the browser you type localhost which is it gonna connect to and whats the difference between them?. if any.

1 Like

If I ping localhost, in Windows, it lists v6 by standard. (::1:) with -v 4. I get 127.0.0.1

Linux I get the same.

Have you tried?

nslookup gives the same.

I don’t have a web server running on my computers to try and connect to

1 Like

While 127.0.0.1 is a routable address, seems that 0.0.0.0 is usually in hosts file to declare a “non-routable” address, and defaults it to localhost. The article does list how it’s treated when it’s about its use as a “client” vs as a “server”.

4 Likes

yeah… pinged it got the same as you although i have 6 disabled.

tried just entering the ip and 0000 was flatly refused cant be reached
while 127.0.0.1 gave a cant connect to website.

i ended up firing up wireshark to grab the output as i was experimenting.
so i will look at the caps when i have more time to play :slight_smile:

You would need a web server running to get anything in a browser

Then do localhost:port and scrape data

Same as like, jellyfin/Plex or web management

1 Like

really i just wanna know what each does thats different from the other.

basically if you have a website set to redirect to local host port 80
but you set local host to 0.0.0.0 did it still get served or is it unreachable.
or 127.0.0.1:80 … …

now i have a minute to play … il go find out :slight_smile:

got my answer https://youtu.be/91PrPbuHdhg?t=366

1 Like

so 127.0.0.1 is literally, just an IP for homesystem, but 0.0.0.0 is a catch-all that can supersede all others?

that’s why we set domains to 0.0.0.0 in the hosts file?

then, literally the next suggested video…

2 Likes