0

I am building a small web app for my company and currently I have this weird issue:

I have 2 instances of the web app running, one accessible through the internet and another one for internal purposes and testing only. The internal version has a public IP address though.

When I try to access the public version of the app with the Lynx command line browser I get what I am supposed to get. So far so good. Now, when I make changes to the hosts file, so that when I try to access the app I would get the 'internal' version, what comes back is again the public version.

On top of that, there seems to be a problem only with my app. Any other website is correctly blocked or redirected when I make changes to the hosts file.

Any ideas?

UPDATE 1:

I tried this:

When running getent hosts I get the correct list from the /etc/hosts file. When I run getent hosts www.example.com though I get the 'outside' address, although the correction is clearly in place.

HBruijn
  • 72,524
  • 21
  • 127
  • 192
dlyk1988
  • 1,644
  • 4
  • 24
  • 36
  • @HBruijn Thanx for the edit. Speed typing got the best of me. – dlyk1988 Jan 13 '15 at 15:01
  • 1
    And `getent hosts ` does indeed return the correct ip-address that you set up in `/etc/hosts`? – HBruijn Jan 13 '15 at 15:02
  • @HBruijn No it does not actually. Although it is clearly in the file, and appears when 'getent hosts'... when 'getent hosts <...>' I get the 'outside' address. – dlyk1988 Jan 13 '15 at 15:05
  • Hmmm then check nsswitch.conf which governs the order/priority of the different name resolution options are used. DNS maybe be placed before files. – HBruijn Jan 13 '15 at 15:09
  • @HBruijn Where might that be? – dlyk1988 Jan 13 '15 at 15:09
  • The most obvious location for configuration files: `/etc/nsswitch.conf`. BTW I edited your question to reflect SF policy to either use your own domain name or example.[com|org] rather than "made up" domains that may exist and don't belong to you. – HBruijn Jan 13 '15 at 15:11
  • Let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/20209/discussion-between-dsljanus-and-hbruijn). – dlyk1988 Jan 13 '15 at 15:13
  • @HBruijn No... It says: 'hosts: files dns myhostname' – dlyk1988 Jan 13 '15 at 15:14
  • maybe internal lynx cache of webcontent? – Andrei Mikhaltsov Jan 13 '15 at 15:27

0 Answers0