Page 1 of 1

Command "resolve" don't return the ip address

Posted: Fri Mar 19, 2021 10:09 pm
by drevil23
Hi,

I've upgraded from a rb3011, v.6.48.1, to a rb4011, also 6.48.1, but one of my script is not working anymore.

It used the command "resolve" to get an IP address, but resolve now return "blank" answer instead of an IP address, it only returns a result when the domain name is bogus.
[user@router] > :resolve yahoo.com
[user@router] > :resolve google.com
[user@router] > :resolve www.cnn.com
[user@router] > :resolve ketchup.com
[user@router] > :resolve anythingatall.ca
failure: dns name does not exist
[user@router] >
Any idea on how to fix that?

Thank you.

Re: Command "resolve" don't return the ip address  [SOLVED]

Posted: Fri Mar 19, 2021 10:12 pm
by eworm
Has always been like that. You need to use the return value.
:put [ :resolve yahoo.com ]

Re: Command "resolve" don't return the ip address

Posted: Fri Mar 19, 2021 10:15 pm
by Jotne
This is due to that most of the commands does not give output directly to cli.

Try
:put [:resolve yahoo.com]
Or like this:
{
:local test [:resolve yahoo.com]
:put $test
}

Re: Command "resolve" don't return the ip address

Posted: Fri Mar 19, 2021 10:30 pm
by drevil23
Thanks, I thought I found out the reason of the script not working, but it wasn't that, you're totally right.

I found out why it didn't work thanks to you guys, a problem with a bad character inside a variable declaration of the web page.

Turns out that using a "$" inside a web page address is a bad thing if you don't put "\" in front.

Thanks guys, you've helped a lot :D