Skip to content
Snippets Groups Projects

get PTR and A record for every IP in network

  • Clone with SSH
  • Clone with HTTPS
  • Embed
  • Share
    The snippet can be accessed without any authentication.
    Authored by Dirk Sarpe
    Edited
    PTR-and-A.sh 273 B
    # get PTR and A record for every IP in network
    # modify to your needs
    
    dns_server=139.18.25.3
    ip_range=$(seq 65 126)
    net_prefix=141.57.252.
    
    for i in $ip_range
    do
      dig +short @"$dns_server" -x "$net_prefix$i" |
      tee /dev/tty |
      xargs -i dig +short @"$dns_server" {}
    done
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Please register or to comment