Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8551241
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T14:09:15+00:00 2026-06-11T14:09:15+00:00

I have all the IPs that I want to dig +trace -x in a

  • 0

I have all the IPs that I want to dig +trace -x in a file called ‘ips’.

I want to only see the ns1 (and/or) ns2 records of the IP and and have the IP and the ns1 or ns2 record output on the same line, like so:

1 - $IP - $NS
2 - $IP - $NS
etc.

Right now, I only have a script I call ‘digdug’, which looks like this…

for i in `cat ips`
do
dig +trace -x $i | tail -n7
done

and then I am able to see the IP that it is digging by running: bash -x digdug

But, what I really need is the IP and the ns record on one line, then the next IP in the list with ns record on the next line. Then the next and so on.

Any help is greatly appreciated!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T14:09:16+00:00Added an answer on June 11, 2026 at 2:09 pm

    Perhaps something like this?

    for ip in `cat ips`; do
      ns=`dig +trace -x $ip | tail -n7 | awk '/NS/ {print $NF}'`
      echo "$ip - $ns" | tr '\n' ' '
      echo ""
    done
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does Dns.GetHostAddresses really get back all registered IPs? That is DNS can have multiple
I want to create a Console Application in VB that broadcasts to all IPs
I have a secure site (.htaccess = Deny from all) that I want to
I have all the time zone information that is needed and it saves all
I have all my views in a project inheriting from a ViewBase class that
I have multiple tables (one for each day) that all have the same structure:
I have a small script which scans all the ips ranging from 192.168.190.xxx to
I have a list of IPs, I have to transform all the lPs starting
I have some servers. Some of them have ips assigned. I want to figure
I want to have a local Gitorious installation that cannot be accessed outside of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.