Community discussions

MikroTik App
 
User avatar
baragoon
Member Candidate
Member Candidate
Topic Author
Posts: 294
Joined: Thu Jan 05, 2017 10:38 am
Location: Kyiv, UA
Contact:

update IPs in address list with domain name

Sat Feb 04, 2017 1:39 pm

Hi all.
Please help.
How to update address list with domain name? For example, I have 1 address list with domain "yandex.ua". When I create it also created "child" entries containing IPs:
 2   list=yandex.ua address=yandex.ua creation-time=feb/03/2017 15:01:32 dynamic=no 

 3 D ;;; yandex.ua
     list=yandex.ua address=5.255.255.55 creation-time=feb/03/2017 15:01:32 dynamic=yes 

 4 D ;;; yandex.ua
     list=yandex.ua address=77.88.55.55 creation-time=feb/03/2017 15:01:32 dynamic=yes 

 5 D ;;; yandex.ua
     list=yandex.ua address=77.88.55.66 creation-time=feb/03/2017 15:01:32 dynamic=yes 

 6 D ;;; yandex.ua
     list=yandex.ua address=5.255.255.5 creation-time=feb/03/2017 15:01:32 dynamic=yes 
And when ip addresses for this domain changes, this list need to be updated (just make disable\enable) and IPs will be fresh.
I'm new in miktotik scripting, please help.
Script need to check all lists (dynamic=no) which names are the same as domains in them and enable\disable them.
 
Sob
Forum Guru
Forum Guru
Posts: 9119
Joined: Mon Apr 20, 2009 9:11 pm

Re: update IPs in address list with domain name

Sat Feb 04, 2017 9:18 pm

It updates automatically. Each DNS record has TTL (time to live) and it's valid until TTL expires. When it happens, RouterOS asks DNS server for fresh records.
 
User avatar
baragoon
Member Candidate
Member Candidate
Topic Author
Posts: 294
Joined: Thu Jan 05, 2017 10:38 am
Location: Kyiv, UA
Contact:

Re: update IPs in address list with domain name

Mon Feb 06, 2017 8:30 am

It updates automatically. Each DNS record has TTL (time to live) and it's valid until TTL expires. When it happens, RouterOS asks DNS server for fresh records.
Oh, thanks. I will check this.

Who is online

Users browsing this forum: Rhydu and 15 guests