New posts. Search forums.
Share your Question. Developers looking to perform name resolution in the same way that other applications on the same operating system behave should use dns. When successful, the Promise is resolved with an array of resource records. For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. Could someone shed some light onto this?
IP name lookup failed x. When using nslookup to query earthlink. There are not errors in Event Viewer.
Any suggestions? Dan DeStefano. Dan, Thank you for the help. We are using internal DNS and do have a reverse lookup zone. For the test, I ping the excahnge server name and ip, both reply. Bob Lin.
Possible causes: 1. Incorrect DNS settings. Posting on MS newsgroup will benefit all readers and you may get more help. Is it just one domain?? Ace Fekay [MVP]. In pc said:. Appending a single period to the hostname does not seem to help.
If you need to store an IP addresses in a database, you can convert and store it in an INT type column 4 bytes. The functions below can convert IP addresses to its integer decimal value and vice-versa. Here is a simple function I compiled from user-notes that works great..
This function seems to be very slow on IIS 4. HostnameLookups On.
I just spent a dickens of a time trying to figure out why my gethostbyaddr's were simply failing halfway through. On each report page, I'm pulling lines from my Db, but only maybe 25 IPs on average. Sometimes this report would generate in under 15 seconds, other times it would fail with a connection reset.
It turns out that several of the IPs in my Db looked like this: x. For my case, I purged the Db and prevented the logging of IPs that contain For ad-rotator.
Here is a fail-safe alternative, 1 sec max for timeout per IP. Just to fun that gethostbyadd returns server machine name known in LAN rather then its DNS if I try to call it against my own host from workstation , whether it would local behind the proxy or global of proxy itself IP or just loop Fun :. To convert an IP to a numeric value, just use the ip2long Vice versa; use: long2ip Be careful with the usage of this function - it will slow down a server to a crawl if called a lot and the slowness won't be reflected in any of the obvious places, like CPU usage, apache requests, SQL etc.
When you do use it make a special note of where! If you use gethostbyaddr with a bad IP address then it will send an error message to the error log. If you don't want your error log file getting too big then first check that the IP address is valid.
In the following example I first check if the IP number starts with a number, if not then don't use gethostbyaddr '.. Anonymous has a good point though I don't agree with pushing to execution to shell unless I have to. Here are two functions that should prove their worth speedwise. Althought I had thought gethostbyaddr would use some kind of cache, it doesn't seem to when the IP is unresolved at least on my win machine.