It's a type of Planche
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

unbound-host-add-local 464B

12345678910111213
  1. #!/usr/bin/env bash
  2. LOCAL_HOSTNAME=${1}
  3. unbound-control local_data_remove ${LOCAL_HOSTNAME} > /dev/null 2>&1
  4. for dns_lookup in $(unbound-host ${LOCAL_HOSTNAME} | grep -Po "(([0-9]+\.){3}[0-9]+|([0-9a-f]+::?)+:?[0-9a-f]+)"); do
  5. if echo ${dns_lookup} | grep -q ":"; then
  6. unbound-control local_data ${LOCAL_HOSTNAME} IN AAAA ${dns_lookup} > /dev/null 2>&1
  7. else
  8. unbound-control local_data ${LOCAL_HOSTNAME} IN A ${dns_lookup} > /dev/null 2>&1
  9. fi
  10. done