I get it, you're using WINS to resolve the name-to-IP mapping.
The nmblookup command distributed with samba can do this from your Linux
box. I'm not aware of any PHP bindings for it, but you could call it
using system() or the backtick operator.
If you're finding this all too much of a hassle, and you consider these
systems servers, we might be able to make static defines for these
machines in the DHCP server.
Mickey Mossey wrote:
> You're right. I can ping by IP.
> In our network here, besides our servers and printers, because of DHCP
> the only thing that's static on our systems is the hostname. On my
> Windows machine I can drop down to a prompt and ping, lets say "Althea"
> and it resolves the host name and returns the IP address. If I log onto
> my Linux box, and try to ping "Althea" it says the host is unknown.
> I can't map name-to-IP because IP addresses will change on the systems
> and it defeats the ultimate purpose of looking up IPs from hostnames.
> If I were to run PHP off one of these W32 machines, I probably would
> have no problem with this because of the browsing services built into
> Windows. Alas, my application server is RHEL.
> gethostbyname() would work to get IPs... if only my server could see
> that host name.
Tech Support Group, Computing & Information Technology
The University of Vermont