none
How is 'localhost' handled RRS feed

  • Question

  • Sorry, but I couldn't figure out where this question belongs...

    How/where is 'localhost' handled? I guess 'localhost' is first resolved to 127.0.0.1 somewhere, but then?

    Is there a loopback interface that is not shown by 'ipconfig' or is that handled in upper layers or where?

    Friday, April 8, 2016 9:46 PM

Answers

  • There are several questions here.  The translation from "localhost" to "127.0.0.1" happens because of /etc/hosts, which is actually located in \windows\system32\drivers\etc\hosts on Windows.  That file contains the static name lookups for your computer.

    The IP address 127.0.0.1 is handled specially in the IP part of the TCP/IP network stack, so it's actually a lower layer.


    Tim Roberts, Driver MVP Providenza & Boekelheide, Inc.

    Monday, April 11, 2016 7:31 AM
  • The IP layer only loosely conforms to the OSI "network" layer, and yes, there is a loopback path in the network stack - depending upon the media type and other factors. Here is where you can find more information on loopback

     -Brian


    Azius Developer Training www.azius.com Windows device driver, internals, security, & forensics training and consulting. Blog at www.azius.com/blog

    • Marked as answer by turboscrew Thursday, April 14, 2016 5:59 AM
    Wednesday, April 13, 2016 12:23 AM
    Moderator

All replies

  • There are several questions here.  The translation from "localhost" to "127.0.0.1" happens because of /etc/hosts, which is actually located in \windows\system32\drivers\etc\hosts on Windows.  That file contains the static name lookups for your computer.

    The IP address 127.0.0.1 is handled specially in the IP part of the TCP/IP network stack, so it's actually a lower layer.


    Tim Roberts, Driver MVP Providenza & Boekelheide, Inc.

    Monday, April 11, 2016 7:31 AM
  • In the Network layer? No loopback devide is involved?

    Tuesday, April 12, 2016 7:32 PM
  • The IP layer only loosely conforms to the OSI "network" layer, and yes, there is a loopback path in the network stack - depending upon the media type and other factors. Here is where you can find more information on loopback

     -Brian


    Azius Developer Training www.azius.com Windows device driver, internals, security, & forensics training and consulting. Blog at www.azius.com/blog

    • Marked as answer by turboscrew Thursday, April 14, 2016 5:59 AM
    Wednesday, April 13, 2016 12:23 AM
    Moderator
  • Thanks!

    Thursday, April 14, 2016 5:59 AM