How to get a value from a list with a string in AppleScript?
This would be my take on this:

set ipList to {"8.8.8.8", "8.8.8.6", "8.8.4.4"}
set Output1 to ""
set Output2 to ""
global Output1, Output2
repeat with i from 1 to number of items in ipList
    set this_item to item i of ipList
    my ipCheck(this_item, i)
end repeat


if Output1 is not "" or Output2 is not "" then
    display dialog (Output1 &amp; Output2) buttons {"OK"} default button 1 with title "Resultaat"
end if

on ipCheck(IP_address, i)
    try
        set ping to do shell script ("ping -c 2 " &amp; IP_address &amp; "| head -2 | tail -1 |cut -d = -f 4")
        if ping contains "ms" then
            set Output1 to Output1 &amp; return &amp; "DNS" &amp; i &amp; "  UP"
        else if ping contains "timeout" then
            set Output2 to Output2 &amp; return &amp; "DNS" &amp; i &amp; " DOWN"
        end if
    end try
end ipCheck