Community discussions

MikroTik App
 
Ixo
just joined
Topic Author
Posts: 22
Joined: Fri Dec 07, 2012 9:43 pm

[Script] - Obtain IP address of the hostname.

Tue Feb 25, 2014 11:51 am

Hi all, hope you can help me.

I need a script which will be obtaining and IP address from a hostname imap.gmail.com and then updating the email server.

I know it should look something like
:local emailip
:set emailip 127.0.0.1
:log info ("Updating email server with: $emailip")
:tool e-mail set address="$emailip"
I cannnot however parse the actual imap.gmail.com IP address to the $emailip variable.

I tried to use PING address=imap.gmail.com but have no idea how to gather just the HOST part of it.
 
SurferTim
Forum Guru
Forum Guru
Posts: 4636
Joined: Mon Jan 07, 2008 10:31 pm
Location: Miramar Beach, Florida

Re: [Script] - Obtain IP address of the hostname.

Tue Feb 25, 2014 2:00 pm

/tool e-mail set address=[:resolve imap.gmail.com]