Script add queues and read static dns

Hi,

I try to add queues from address list and add to comment host name from dns.

To add queues from address list works fine. Problem is to add HostName from DNS.

:local hostip
       :local list
       :local testvalue
       :local hostdns
      
       :log info "******************** starting - address list queue create ********************"
 
       :foreach i in=[/ip firewall address-list find list=ipLAN] do={

              :set list ([/ip firewall address-list get $i list] )
              :set hostip ([/ip firewall address-list get $i address] )
             
        
              :set testvalue [/queue simple find name=$hostip]
          


              :if ([:len $testvalue] <= 0) do={
                     :if ($list = "ipLAN") do={
                            :set hostdns [/ip dns static find name where address=$hostip]
                             /queue simple add name=$hostip comment="ipLAN $hostdns"  target=$hostip queue=default/default total-queue=default

                      } else={

           
                                 }
                      } else={
                         
                        }
       }

My problem is that line:
:set hostdns [/ip dns static find name where address=$hostip]

Can anybody help me ?


Best Regards,

Do you want to resolve the IP to a name?
Maybe use :resolve.

:put [:resolve 8.8.8.8]
google-public-dns-a.google.com

I have static dns address and I want to add at the comment the address for that ip.


Regards