0

I can browse my server site using

 ip:8080

which is inside my home network.But I am not able to browse using

 hostname:8080

I do not have dns server. I have edited /etc/hosts file to include hostname and ip. I can ping using hostname.

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
10.16.2.12 apple.myserver.com
10.16.2.22 ball.myserver.com
10.16.2.20 cat.myserver.com
10.16.2.19 dog.myserver.com
10.16.2.18 elep.myserver.com

Similar Issue Here.

2
  • 2
    Does it also not work if you explicitly say http://hostname:8080? Browsers have become worse in recognizing what is not a "omnibox" style search query. Nov 27, 2015 at 13:00
  • @UlrichSchwarz It does not work. But when I use IP it works. I use mozilla firefox.
    – kinkajou
    Dec 12, 2015 at 13:55

1 Answer 1

0

If you don't have DNS (so it is not registered and not resolving globally) then all you need is to add the same host entry in your PC/laptop in order to access to it via hostname.

8
  • I already havve it in /etc/hosts
    – kinkajou
    Dec 12, 2015 at 13:51
  • apparently you have the wrong setup. pls post the output of "cat /etc/hosts && hostname -f " and also ping the hostname from the host itself.
    – ostendali
    Dec 14, 2015 at 10:00
  • I have edited my question.
    – kinkajou
    Dec 14, 2015 at 10:21
  • if pinging the hostname replies then it should work. you didn/t posted the output for hostname -f. also it is all on single machine right? I mean you have everything on one machine? because it sounds like that, otherwise pls be more specific if you are using 2 separate machines.
    – ostendali
    Dec 14, 2015 at 10:37
  • I have many machines. virtual machines! hostname -f results one of hostname.
    – kinkajou
    Dec 14, 2015 at 10:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .