Quality Learning Support For All
First time here? Checkout the FAQs!
x
MathsGee is Zero-Rated (You do not need data to access) on: Telkom |Dimension Data | Rain | MWEB

0 like 0 dislike
37 views
What is the difference between 127.0.0.1 and localhost?
in Data Science & Statistics by Diamond (81,178 points) | 37 views

1 Answer

0 like 0 dislike

Well, the most likely difference is that you still have to do an actual lookup of localhost somewhere.

If you use 127.0.0.1, then (intelligent) software will just turn that directly into an IP address and use it. Some implementations of gethostbyname will detect the dotted format (and presumably the equivalent IPv6 format) and not do a lookup at all.

Otherwise, the name has to be resolved. And there's no guarantee that your hosts file will actually be used for that resolution (first, or at all) so localhost may become a totally different IP address.

By that I mean that, on some systems, a local hosts file can be bypassed. The host.conf file controls this on Linux (and many other Unices).

If you use a Unix domain socket it'll be slightly faster than using TCP/IP (because of the less overhead you have). Windows is using TCP/IP as a default, whereas Linux tries to use a Unix Domain Socket if you choose localhost and TCP/IP if you take 127.0.0.1.

by Diamond (81,178 points)

Related questions

0 like 0 dislike
0 answers
asked Aug 30, 2019 in Data Science & Statistics by MathsGee Diamond (81,178 points) | 47 views
0 like 0 dislike
0 answers
0 like 0 dislike
1 answer
asked Aug 29, 2019 in Data Science & Statistics by MathsGee Diamond (81,178 points) | 36 views
0 like 0 dislike
1 answer
asked Apr 28, 2020 in Mathematics by MathsGee Diamond (81,178 points) | 44 views
0 like 0 dislike
0 answers
0 like 0 dislike
1 answer
0 like 0 dislike
0 answers

Join the MathsGee Answer Hub community and get study support for success - MathsGee Answer Hub provides answers to subject-specific educational questions for improved outcomes.



On MathsGee Answers, you can:


  1. Ask questions
  2. Answer questions
  3. Comment on Answers
  4. Vote on Questions and Answers
  5. Donate to your favourite users
  6. Create/Take Live Video Lessons

Posting on MathsGee


  1. Remember the human
  2. Behave like you would in real life
  3. Look for the original source of content
  4. Search for duplicates before posting
  5. Read the community's rules
MathsGee Tools

Math Worksheet Generator

Math Algebra Solver

Trigonometry Simulations

Vectors Simulations

Matrix Arithmetic Simulations

Matrix Transformations Simulations

Quadratic Equations Simulations

Probability & Statistics Simulations

PHET Simulations

Visual Statistics

MathsGee ZOOM | eBook