Unruh wrote:
> xi@videotron.ca writes:
>
> >hello,
>
> >We have two environments, one for test and one for the production.
>
> >Because our applications need the hostname in a lot of configuration
> >files, we choose to leave the hostname of the production server in the
> >configuration of the test environment. Therefore, to resolve the ip
> >address to the proper server we have an entry in a DNS server to
> >resolve for the production server. For the test environment, we
> >defined an entry like "11.22.33.44 prodsrv" in /etc/hosts and we
> >have "hosts: files dns" in the file /etc/nsswitch.conf.
>
> >Now, on our test server when we do `nslookup prodsrv`, it gives us the
> >ip address of the production server rather than the address of the test
> >server.
>
> nslookup is the wrong tool. Its whole purpose is to query dns servers.
> Do
> ping prodsrv
> and look at the address used if you want to see if something uses
> /etc/hosts.
>
>
Thanks! I didn't know nslookup and host, for that matter, does not use
the hosts file. ping confirmed the resolution was as requested.
Everything works smoothly now.
Thanks,
Bernard
> >How come nslookup on the test server does not resolve to the ip address
> >of test server? What could be wrong?
>
> >Our linux distro is SuSE version 9 patchlevel 2.
>
> >Thanks in advance,
> >Bernard