[kwlug-disc] Getting external IP

Ronald Barnes ron at ronaldbarnes.ca
Sun Jan 28 22:17:01 EST 2018


bob+kwlug at softscape.ca wrote on 2018-01-28 06:27 PM:

>> There used to be outsideip.net but it went off-line, so I made a DNS
>> server for KWVoIP - in Python - that provides that functionality:
>>
>> $ dig +short  my.ip @kwvoip.ca
>> 69.172.174.43

> Ronald,
> 
> How did you set up your DNS server to do this?
> 
> My google fu is failing me.

I had to write my own.

As far as I know, there's no way to get bind9 / named to respond to such 
a query in the desired manner.

If anyone knows a way, let me know!


And it was a rather surprisingly difficult task. I expected to watch 
incoming queries for some text like, "my.ip" and simply spit out the 
query source's IP address.


I was so young, dumb, and naïve way back then, in 2017...


It's all binary packed bytes, so '\x02my\x02ip\x00' to find "my.ip", 
plus headers of course.


If you want details, I can probably provide them, just let me know.


r b





More information about the kwlug-disc mailing list