I writing a quick script to show what domains are currently in a users
dns cache. 
I only want the root domain itself, not anything past that. 

So if I run this:
for /F "tokens=*" %%X in ('ipconfig /displaydns') DO echo %%X | find
"CNAME Record" >> list.txt
for /F "tokens=8" %%X in ('type list.txt') DO echo %%X >> list2.txt

list2.txt contains output like this:
map-pb.quantserve.com.akadns.net 
techtalkz.com
www-google-analytics.l.google.com
etc, etc, etc

How would I strip out only the last 3 tokens so that I would end up
with:
akadns.net
techtalkz.com
google.com



Thanks in advance,
Jon






~ Finally, powerful endpoint security that ISN'T a resource hog! ~
~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/>  ~

Reply via email to