Windows – How is localhost resolved by Oracle listener

installationoraclewindows

When I o an Oracle test installation on a Windows server accepting mostly the defaults, I end up with a listener.ora like

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    )
  )

THat never seems to enable the listener, to accept requests from remote machines.
I have to add a line with the actual IP address or DNS-name of the server. Giving something like

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = 169.254.239.75)(PORT = 1521))
    )
  )

From Technet I know, that Windows has ways to resolve localhost others than reading from etc/hosts. And typing

ping localhost

shows this.

Each time I do a test installation I have to manually edit listener.ora and tnsnames.ora files and replace the localhost by actual data.

Is the problem to resolve localhost caused by having more than one network adapters?

My normal test configuration is a virtual machine with one adapter connected to the internal network and another connected to the internet via NAT.

Is localhost in those files thought as template to be replaced by a real dns-names or IP-adresses or are there true server-configurations, where the files can be used as generated by DBCA?

Best Answer

By definition localhost traffic is never supposed to enter or leave the server. It is a name for the addresses 127.0.0.1 and ::1. It will be bound to a loopback device. localhost is useful to allow IP access to services running on the local machine.

You likely want to use the host name of your virtual server rather than localhost. This should resolve to you network interfaces.