'lsof' will tell you. Usually listeners bind to a specific port, or use getsocketname to acquire their own port and send it to a correspondent, like in passive FTP.
As far as IP goes, you can listen on 0.0.0.0 = any, localhost 127.0.0.1, any IP of devices on your host. Otherwise, you get nothing.
I'm sorry for not being more specific in my query.
The concern is while configuring the server if I specify the DNS name then
http://<IP>:port/console
Does not yeild the webpage and visa-versa. So i have to know using the pid is the server is listening on the DNS name, if so what is it and if it is listening on the IP address and what it is.
The server will definitely not listen on the DNS name but on IP address (numbers). Anything having to do with server/domain names is the part of DNS services, even if you see names in some listings.
You may well have a problem with DNS, though.
Are you talking about one server pretending to be many? It depends on the HTTP Header referring page or original host name to decide which server to pretend to be, no magic, and with IP it must default.
lsof is pretty system-independent once you have one for each system. If you have multiple IP server sockets can be listened on 0.0.0.0 (all), 127.0.0.1 (localhost only)or any of those addresses, which would have different host.domain names.
In practice, usually one server listening on 0.0.0.0 splits connections on multiple virtual server file trees based on the http header host.domain name. The host can have one IP with many DNS CNAME host.domain names that resolve to it. Browsers putting that IP in the URL or running on the server host using 127.0.0.1 will get the default virtual host.domain web service.