Change connect-to via script - variable - failure: dns name does not exist

Hello Guys,
I’m on MT since 2 years and now I work on a “fun” project for me.

Following situation, I have a ipvanish account, after the thing with the NSA I’m trying to make it so much complicate as possible to follow my traces, so I’m trying following:

I have setup my IPVanish L2TP on MT (v6.32.2) everything works fine, I can route my traffic trough it, but now my problem, I want to change the IPVanish Server every 10 Minutes via a Automatic script which parses a .txt-File on my MT, thats also no problem but now I stuck in following situation, in my var $line I have the string: http://www.google.com or similar, now I try following:

/interface l2tp-client set l2tp-ipvanish connect-to=[:resolve $line]

but that doesn’t work he tells me: failure: dns name does not exist, if I write

/interface l2tp-client set l2tp-ipvanish connect-to=[:resolve www.google.com]

everything works fine, I have searched on google and also here, but have not found any answer, I thought about wrong DataType and that seems to be the problem, but :toip $line also doesn’t work…

It would be great if someone could help me or give me a hint about it, I’m searching now more than 5 hours with this Issue :frowning:

Thanks Guys,
Dominik

You have to remove “http://” from $line,with this command you can leave string starting from “www”

{
:local line “http://www.google.com
:local nline ([:pick $line [find $line “www”] [:len $line]])
:do {:put [resolve $nline]} on-error={:put “DNS Does not exist for $nline”}
}

Thanks paul for your fast replay, I have found the issue 2 hours after creating the Post, but it wasn’t moderated so I was unable to replay. :slight_smile:

It was as simple as horrible, I have parsed the *.txt File and every line was a URL, but as I have picked it with :pick it have already the linebreak cuted out, so yep it wasn’t a corret URL, but in the Enviroment View (Scripts/Enviroment) the URL looked good have found it via :put the terminal shows me 2 Lines (needed additional 20 min until I realized hat haha).
After changing to cut 1 letter less everything works fine now, my IP changed every 5 minutes - great!

P.s. @Paul, Thanks but the “http” was applied by the phpBB Software at posting time :slight_smile: