Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: gethostbyname() problem

by frieduck (Hermit)
on Mar 28, 2009 at 13:52 UTC ( #753850=note: print w/ replies, xml ) Need Help??


in reply to gethostbyname() problem

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:

hosts: files dns
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.


Comment on Re: gethostbyname() problem
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://753850]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2014-08-31 05:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (294 votes), past polls