Localhost is always IP address 127.0.0.1. This is also known as the loopback address because every machine uses this same address to refer to itself. You do not have to do anything special to set this up. That is; you do not require a DNS (domain name server) to resolve the localhost name to IP address 127.0.0.1 because it is "hard-wired".
If you have a local webserver running, entering "localhost" or "127.0.0.1" in your browser will bring up the default page for that server. Other machine's on your network can also access your local webserver, but they must use your machine's local area address or the machine name to access it (if they use localhost they'll simply refer to themselves). If you do not have a webserver running, your browser will simply tell you that the web page is not available. Setting up a webserver is simply a matter of installing one. Consult the webserver documentation for information on configuring it.
Chat with our AI personalities
The localhost is your own machine. It has the fixed address 127.0.0.1, so there's nothing to configure.