lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


One other nice thing about OpenDNS is that you can simply do a reverse
lookup on myip.opendns.com to get your IP address.

This can be accomplished from luasocket using the following:

require("socket")
myip = socket.dns.toip("myip.opendns.com")

Keep in mind the host running the above code must be using the OpenDNS
nameservers for DNS.  The IP's of the OpenDNS servers are:
208.67.222.222 and 208.67.220.220

On Sun, Apr 11, 2010 at 8:39 AM, Stuart P. Bentley
<stuart@testtrack4.com> wrote:
> whatismyip.org isn't terribly reliable, though (It's been down for days at a
> time in my experience), so I wouldn't use it in automation. OpenDNS provides
> http://myip.dnsomatic.com/ (designed for use with apps for their DNS-O-Matic
> DNS update synchronization service) to the same ends, and it has all the
> reliability of an OpenDNS service (nobody has ever seen it go down, to my
> knowledge).
>
> On Sun, 11 Apr 2010 07:22:53 -0600, Enrico Colombini <erix@erix.it> wrote:
>
>> Erik Lindroos wrote:
>>>
>>> I would suggest http://whatismyip.org/
>>
>> Very convenient for automation, thanks.
>>
>>   Enrico
>
>