How do you do a DNS lookup, like nslookup?
Is there a way to do this easily? I can't seem to get this to work.
10 posts
(note the * and the . before r2). It is a pointer (hence the *) and you are getting it out of the function (hence the .).System::Call 'ws2_32::WSAStartup(i 514, *i .r2) i .r3'
I am not also sure about the 't r5' on the third call. You get an unsigned long from the second call to $5 and then you place this as a 't' on the third call?System::Call '*(t,t,i,i,t)i.s'
Pop $6
System::Call 'ws2_32::gethostbyaddr(t r5, i 4, i ${AF_INET}) i r6'
This gives you the full domain name. For example if $IPADDRESS is '205.188.229.57' $R1 will be 'waforumweb-dtc1l-0.stream.aol.com'!define AF_INET 2
!define strhostent '(t,t,i,i,t)i'
StrCpy $IPADDRESS "aaa.xxx.yyy.zzz" ; put your address here
System::Call 'Ws2_32::WSAStartup(i 514, *i .r2) i .r3'
System::Call 'Ws2_32::inet_addr(t "$IPADRESS") l .r5'
System::Call 'Ws2_32::gethostbyaddr(*l r5, i 4, i ${AF_INET}) i .r6'
System::Call '*$6${strhostent}(.R1,,,,)'
DetailPrint 'The full DNS name of "$IPADDRESS" is "$R1"'
System::Call 'Ws2_32::WSACleanup()i.R9'
System::Free $6
Originally posted by CancerFaceThanks dude. I'm sorry for not getting back to you, I'm on vacation!
This code works:
This gives you the full domain name. For example if $IPADDRESS is '205.188.229.57' $R1 will be 'waforumweb-dtc1l-0.stream.aol.com'!define AF_INET 2
!define strhostent '(t,t,i,i,t)i'
StrCpy $IPADDRESS "aaa.xxx.yyy.zzz" ; put your address here
System::Call 'Ws2_32::WSAStartup(i 514, *i .r2) i .r3'
System::Call 'Ws2_32::inet_addr(t "$IPADRESS") l .r5'
System::Call 'Ws2_32::gethostbyaddr(*l r5, i 4, i ${AF_INET}) i .r6'
System::Call '*$6${strhostent}(.R1,,,,)'
DetailPrint 'The full DNS name of "$IPADDRESS" is "$R1"'
System::Call 'Ws2_32::WSACleanup()i.R9'
System::Free $6
🙂
CF
and the gethostname thread I believe is wrong since its not allocating a buffer to store the name (I had to combine the two).🧟