# lookup address 'solidt.eu' ipv4 in nameserver 8.8.8.8 and store the result in environment variable export MY_IP=$(dig +short @8.8.8.8 "solidt.eu" A) $ns=8.8.8.8 $domain="solidt.eu" export MY_IP=$(dig +short @$ns $domain A) # bonus: store variable to file # and load variable from file for e.g. another session echo "$MY_IP" > /tmp/my_ip $MY_IP=$(cat /tmp/my_ip)
923900cookie-checkLinux / Ubuntu lookup domain / nslookup in variable