Afraid.org dns script using specific wan port

Hi guys

I am trying to update my dns address for a specific wan port and would like to know if its possible with wget script. I have a 3 wan ports and would like to update address of wan3. Wan1 is my first route which means every time i run the script wan1 ip gets sent to afrad.org. Any way i can throw a interface=wan3 into the wget script or something which will send wan3 address to afraid?


/tool fetch url="http://freedns.afraid.org/dynamic/update.php\randomKey"

Thanks

I have looked into this before. As far as I figured out it isn’t possible in a simple fashion. … I came up with a theoretical solution to utilize “modified” URLs and some mangle rules to mark routes…

e.g. /tool fetch url=“http://freedns-ETH1.afraid.org/dynamic/update.php\randomKey” … or something like that… match on layer-7. I never actually tested the idea though.

Freedns.afraid.org now for me is 178.33.33.231

So you can do this:
/ip route add dst-address=178.33.33.231 gateway=1.1.1.1

Change 1.1.1.1 for your wan3 gateway

Send from my mobile phone using Tapatalk.

I guess this might work if you where only updating 1. In my case I have 3 wan ports I need to update.

You “could” script it… so update the route… fetch… update the route… fetch again… update the route… fetch… etc…

That might actually work as long as it is timed correctly…

May this could answer:

# get freedns.afraid.org
:global a [:resolve freedns.afraid.org]
#update ddns from wan1
/ip ro add dst-address=$a gateway=wan1 comment=ddns
/tool fetch url="http://freedns.afraid.org/dynamic/update.php\randomKey"
#update ddns from wan2
/ip ro add dst-address=$a gateway=wan2 comment=ddns
/tool fetch url="http://freedns.afraid.org/dynamic/update.php\randomKey"
#update ddns from wan3
/ip ro add dst-address=$a gateway=wan3 comment=ddns
/tool fetch url="http://freedns.afraid.org/dynamic/update.php\randomKey"
# remove static gateway
/ip ro rem [find comment=ddns]

Is “fetch” a blocking call?.. e.g. is it guaranteed to finish before continuing the script?

Yes, it work fine. I have test it, with some corrections:

# get freedns.afraid.org
:global a [:resolve freedns.afraid.org]
#update ddns from wan1
/ip ro add dst-address=$a gateway=wan1 comment=ddns
/tool fetch url="http://freedns.afraid.org/dynamic/update.php\randomKey"
#update ddns from wan2
/ip ro set  [find comment=ddns] dst-address=$a gateway=wan2 
/tool fetch url="http://freedns.afraid.org/dynamic/update.php\randomKey"
#update ddns from wan3
/ip ro set  [find comment=ddns] dst-address=$a gateway=wan3 
/tool fetch url="http://freedns.afraid.org/dynamic/update.php\randomKey"
# remove static gateway
/ip ro rem [find comment=ddns]

Tried it but when i run the script no route is added.

Because the last line removes the route…

/ip ro rem [find comment=ddns]

I know that but wile i am running the script should i not see it come and go?

Maybe.. Just depends on the speed

Sent from my SCH-I545 using Tapatalk

Freedns has a hidden feature, you can add &address=x.x.x.x to the update url

4). If you are behind a firewall and Free DNS is not detecting your IP address correctly, you can add &address=127.0.0.2 to the update string, to override Free DNS auto-detection. To see the order and/or HTTP variables checked that Free DNS attempts to detect your IP address, you can click here