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.

9
  • @HBruijn Thanx for the edit. Speed typing got the best of me.
    – dlyk1988
    Commented Jan 13, 2015 at 15:01
  • 1
    And getent hosts <fully-qualified-hostname> does indeed return the correct ip-address that you set up in /etc/hosts?
    – HBruijn
    Commented Jan 13, 2015 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
    Commented Jan 13, 2015 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
    Commented Jan 13, 2015 at 15:09
  • @HBruijn Where might that be?
    – dlyk1988
    Commented Jan 13, 2015 at 15:09

0

You must log in to answer this question.

Browse other questions tagged .