Page 1 of 1

ip reverse dns lookup

Posted: Sun Jun 23, 2013 5:50 pm
by kalzcosta
Hey friends,


Is it possible to configure a reverse dns lookup (dns server) on mikrotik v6.0 ?

Re: ip reverse dns lookup

Posted: Tue Jun 25, 2013 5:38 pm
by letabawireless
According to my knowledge, no. You would need to have a proper DNS Server for those type of records. Anyway, the reverse DNS lookup is normally done by the owner of the IP, and that normally is your ISP, not you.

Re: ip reverse dns lookup

Posted: Sat Dec 21, 2013 8:49 am
by pwuk
Sure

(Private network on 192.168.81.254/24, local pc on .100, usual masquerading)

Set up your router like this
/ip dns
set allow-remote-requests=yes servers=8.8.8.8,8.8.4.4
/ip dns static
add address=192.168.81.100 name=mypc.me.com
add address=192.168.81.254 name=myrouter.me.com

Then run this on your PC
$ host 192.168.81.100 192.168.81.254
100.81.168.192.in-addr.arpa domain name pointer mypc.me.com

(On windows I believe it's "nslookup 192.168.81.100 192.168.81.254" -- basically ask to resolve 192.168.81.100 using server 81.254)

Re: ip reverse dns lookup

Posted: Fri Dec 14, 2018 8:31 pm
by SiB
Is it possible to configure a reverse dns lookup (dns server) on mikrotik v6.0 ?
Still answer is NO, the
:resolve
not support query with types of records like "type=ptr".

WorkARound1 => Tracert to file, read last line and grab second parameter
execute {tool traceroute count=1 use-dns=yes 8.8.8.8} file=tracert.txt
put [file get tracert.txt contents ]
...
6 google-public-dns-a.google.com     0%    1   0.6ms     0.6     0.6     0.6

WorkARound2 => Use HTTP API and grab second parameter
put ([tool fetch url=("https://api.hackertarget.com/reversedns/\?q=8.8.4.4") output=user as-value ] -> "data") 
8.8.4.4 google-public-dns-b.google.com

WorkARound3 => Geo IP from HTTP API (FREE, registration needed) and grab data from JSON format
local key "at_*********************";
local ip "8.8.8.8";
put ([tool fetch url=("https://geo.ipify.org/api/v1\?apiKey=".$key."&ipAddress=".$ip) output=user as-value ] -> "data")
{"ip":"8.8.8.8","location":{"country":"US","region":"California","city":"Mountain View","lat":37.40599,"lng":-122.078514,"postalCode":"94043","timezone":"-08:00"}}
Remember to use "\?" if your URL have got a "?" inside.
Yes,Yes, I know that "sed" & "awk" & "JSONparser" will be perfect :) and the ROSv7 will have all solutions included, new kernel, etc. ...