Community discussions

MikroTik App
 
camulodunum
just joined
Topic Author
Posts: 9
Joined: Sat May 27, 2023 3:34 am

any method to get external DNS ip of a local dns?

Sat May 27, 2023 3:44 am

I have my local home network,wich has a server that,with other things,have multiple webpages wich have multiple dns.

since those dns point to my wan IP and wanted to get acces to those webpages from local network (reverse proxy) decided to declare my domains in the mikrotik local dns server.

the problem now is that I have dynamic IP ,so have few scripts to upgrade the IP when needed.

those scripts compare the resolved dns ip to my public IP to send a command to change IP only when needed.

the problems is that,thanks to my local dns changes,now those dns resolves to my local IP and not the true external IP that i need for the comparison.

hairpin is not possible since this involves port 80 and 443 and that will invalidate my access to websites outside the local network.

so there's some way to get the real external IP of my domain that does not implies using mikrotik dns resolver command?
 
abbio90
Member Candidate
Member Candidate
Posts: 163
Joined: Fri Aug 27, 2021 9:16 pm
Contact:

Re: any method to get external DNS ip of a local dns?

Tue May 30, 2023 1:14 am

you can enable ip Cloud and fetch the public ip with a script from that field
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11967
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: any method to get external DNS ip of a local dns?

Tue May 30, 2023 10:02 am

you can enable ip Cloud and fetch the public ip with a script from that field

Just specify the server you want to use for :resolve

example code

:put [:resolve www.example.com] ; # resolved locally
:put [:resolve www.example.com server=1.1.1.1] ; # resolved externally
 
camulodunum
just joined
Topic Author
Posts: 9
Joined: Sat May 27, 2023 3:34 am

Re: any method to get external DNS ip of a local dns?

Wed May 31, 2023 2:05 am

I just found the cloud option a bit earlier today (just lucky,my brain can't understand why a ddns server whould be in ip->cloud section of the interface,but anyway) and enabled it and did it as abbio90 said, but rextended option is much more elegant since don't have to rely on another ddns service,so gonna go with that.


thank you both for the help.

Who is online

Users browsing this forum: Rhydu and 13 guests