|
|
| Just another Perl shrine | |
| PerlMonks |
Re: gethostbyname() problemby frieduck (Hermit) |
| on Mar 28, 2009 at 13:52 UTC ( #753850=note: print w/ replies, xml ) | Need Help?? |
|
As ikegami has pointed out, your system name resolution isn't doing what you want, so Perl won't either, as it uses the same underlying libraries to do so. On many/most *nix systems, name resolution is controlled by entries in /etc/nsswitch.conf. You'll find a line there for "hosts" that will control where your system looks to resolve names, and in what order it does. For your system to look at /etc/hosts first, you'll want your file to have a line that looks like: This line essentially says, "look at /etc/hosts, and if you don't find it there, use DNS". If your /etc/nsswitch.conf file looks right, your /etc/hosts may have other issues that prevent that line from matching.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||