![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | DNS Query with WSH Hi all, I am trying to analyze web server's log and need to convert IP addresses in the log into human-readable host name. I need to write a script that accepts IP addresses from STDIN or somewhere else, and prints correspobnding FQDN. For instance, it should read an IP address '61.211.239.46' and write 'sodans.usata.org'. I am now capturing NSLOOKUP's output, but it is not smart because there are considerable overhead of calling NSLOOKUP.EXE for each IP address. So I have a question: is there any smart and fast method to do a DNS query on WSH (JScript/VBScript)? I am working on Windows XP Pro and Vista Business, both 32-bit Japanese edition. Thanks in advance. -- -- ======================================================================== (Mr.) IIJIMA Hiromitsu, Chairman of DENNOU GEDOU GAKKAI, N.D.D. http://www.dennougedougakkai-ndd.org/~delmonta/ mailto:delmonta@xxxxxx |
My System Specs![]() |
| | #2 (permalink) |
| | Re: DNS Query with WSH One possibility is here: www.jsware.net/jsware/scripts.php5#jshttp The download is a component that, among other things, does IP -> Hostname conversion. There's also a pre- written script included (IPInfo.vbs) for processing server logs. It uses both hostname resolution and a free database to convert something like: 100.100.100.100 to something like: server123.somewhere.com - Akron-OH-US The component must be registered on the system but has no dependencies. It uses the Windows sockets API directly. I have no experience with STDIN. I'm not sure how that would fit with this component. The IP processing script is just a drag-drop operation. You edit the script to accomodate your server log format. Then drop a log onto the script. The script then generates a duplicate log with the IP numbers replaced by hostname-location. Quote: > Hi all, > > I am trying to analyze web server's log and need to convert > IP addresses in the log into human-readable host name. > > I need to write a script that accepts IP addresses from STDIN or > somewhere else, and prints correspobnding FQDN. For instance, > it should read an IP address '61.211.239.46' and write > 'sodans.usata.org'. > > I am now capturing NSLOOKUP's output, but it is not smart because > there are considerable overhead of calling NSLOOKUP.EXE for each > IP address. > > So I have a question: is there any smart and fast method to do a > DNS query on WSH (JScript/VBScript)? > > I am working on Windows XP Pro and Vista Business, both 32-bit > Japanese edition. > > Thanks in advance. > > > -- > -- > ======================================================================== > (Mr.) IIJIMA Hiromitsu, Chairman of DENNOU GEDOU GAKKAI, N.D.D. > http://www.dennougedougakkai-ndd.org/~delmonta/ > mailto:delmonta@xxxxxx |
My System Specs![]() |
| | #3 (permalink) |
| | Re: DNS Query with WSH Thanks, mayayana. I have to tell one more restriction: the script file must be portable and available to non-Admin users. Therefore, I must avoid registering a new OCX component to the system. If I am allowed to distribute a pair of large files, I would use perl's built-in gethostbyaddr() function. It requires PERL.EXE and PERL58.DLL be distributed together. If a DNS query can be done by WSH, I will no longer need to distribute those large files.... "mayayana" <mayaXXyana@xxxxxx> wrote in message news:ObEbd%23o2JHA.1096@xxxxxx Quote: > One possibility is here: > > www.jsware.net/jsware/scripts.php5#jshttp > > The download is a component that, among other things, > does IP -> Hostname conversion. There's also a pre- > written script included (IPInfo.vbs) for processing server > logs. It uses both hostname resolution and a free database > to convert something like: > 100.100.100.100 > to something like: > server123.somewhere.com - Akron-OH-US > > The component must be registered on the system but has > no dependencies. It uses the Windows sockets API directly. Quote: Quote: >> I am trying to analyze web server's log and need to convert >> IP addresses in the log into human-readable host name. >> >> I need to write a script that accepts IP addresses from STDIN or >> somewhere else, and prints correspobnding FQDN. For instance, >> it should read an IP address '61.211.239.46' and write >> 'sodans.usata.org'. |
My System Specs![]() |
| | #4 (permalink) |
| | Re: DNS Query with WSH Thanks hth, it worked envn on Windows 98 which does not have nsloopup.exe. Quote: > you try can to use "ping -a 61.211.239.46" ... maybe this is faster then > nslookup > > hth Quote: Quote: Quote: >>>> I am trying to analyze web server's log and need to convert >>>> IP addresses in the log into human-readable host name. >>>> >>>> I need to write a script that accepts IP addresses from STDIN or >>>> somewhere else, and prints correspobnding FQDN. For instance, >>>> it should read an IP address '61.211.239.46' and write >>>> 'sodans.usata.org'. |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| SP2 query... | Vista General | |||
| Tab key query | Vista General | |||
| ram query | Overclocking & Cooling | |||
| RAM query | General Discussion | |||