How to repeatedly test DNS lookup in a loop

I suspect an application is running slowly because its doing a DNS lookup repeatedly, and the hosts file may be in error

There are complications on why I can not quickly debug this

So my question is:  is there a simple test that would perform a DNS look up repeatedly (cant use ping, but can use host)

Could someone please post a quick script or something like taht


btw, running suse
Anthony LuciaAsked:
Who is Participating?
Gerwin Jansen, EE MVEConnect With a Mentor Topic Advisor Commented:
You mean just running nslookup's from a script?

Like this maybe:

while [ ${num} -lt 100 ]
  nslookup host
  sleep 1

The above will do 100 host lookups.
Not sure of the servers you're looking up so here is something that I use to help me write quick scripts.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.