ipname

hostnames for all

View the Project on GitHub ebal/ipname

ipname

hostnames for all

description

This is a free public service that resolves any domain name to it’s IP address. If no IP Address in the hostname, then this dns service will reply with your IP Address usage

    192.168.1.1.ipname.me ---> 192.168.1.1
foo.192.168.1.1.ipname.me ---> 192.168.1.1
www.192-168-1-1-ipname.me ---> 192.168.1.1

but

thisisnotarealdomain.tld ---> 116.203.115.192

dig examples

$ dig +short @ipname.me 10.20.30.40
10.20.30.40

$ dig +short @ipname.me www.192.168.1.1
192.168.1.1

$ dig +short @ipname.me www.192-168-1-1-ipname.me
192.168.1.1

$ dig +short @ipname.me example-93.184.216.34-org
93.184.216.34

but

$ dig +short @ipname.me googleyahoo.com
116.203.115.192

who it works

dnsdist supports Lua via LuaJIT, so we can use string.match for our pattern matching.

string.match(reply, "%d+%.%d+%.%d+%.%d+")

then we access the FFI library, which allows calling external C functions and using C data structures from pure Lua code. And with the help of INET_PTON, we can validate the IPv4 from the hostname!


The entire configuration is about 42lines!!! You can check it here: dnsdist.conf

update:

mentions

inspired by xip.io & ifconfig.co

Powered by dnsdist & lua

footnote

This is only for testing purposes, do not use it for production service.