NetAdminTools.com
 
Categories:
GNU/Linux | Homebrew designs | Perl | Administration | Backup/Recovery | Bugs/Fixes | Certification | Database | Email | File/Print | Hardware | Information Grab Bag | Interoperability | GNU/Linux ABCs | Monitoring | Name Resolution | Network Services | Networking | Remote Control | Security | Desktop | Web | BSD | Solaris | GIAGD | REALbasic

Last 30 Days | Last 60 Days | Last 90 Days | All Articles | RSS | Hail Support


Categories:
·GNU/Linux
·Homebrew designs
·Perl
·Administration
·Backup/Recovery
·Bugs/Fixes
·Certification
·Database
·Email
·File/Print
·Hardware
·Information Grab Bag
·Interoperability
·GNU/Linux ABCs
·Monitoring
·Name Resolution
·Network Services
·Networking
·Remote Control
·Security
·Desktop
·Web
·BSD
·Solaris
·GIAGD
·REALbasic
·All Categories


Obtaining sorted DNS listings from an NT command prompt
Topic: Name Resolution   Posted:1997-07-12
Printer Friendly: Print

spacer
It is fairly easy to obtain DNS information for a domain listed by name or IP address. You can use the following procedure regardless of what platform your DNS is running on. You can also use this to verify what names your DNS thinks it is resolving, since this won't necessarily match your hosts file.

Here is an NT command prompt session that illustrates the process. All commands are built-in functions of NT. You could always edit gr.txt to get rid of the NS entry.

Microsoft(R) Windows NT(TM)
(C) Copyright 1985-1996 Microsoft Corp.

D:\>nslookup
Default Server: wormy.groceryshoppin.com
Address: 10.50.100.25
[Note: if the default server doesn't have the records you want, type "server " at the > prompt in nslookup.]
> ls -t groceryshoppin.com > gr.txt
[wormy.groceryshoppin.com]
Received 7 records.
> exit

D:\>type gr.txt
> ls -t groceryshoppin.com
[wormy.groceryshoppin.com]
groceryshoppin.com.NS server = wormy.groceryshoppin.com
pooldogA10.50.100.22
wormyA10.50.100.25
bruceleeA10.50.100.3
u-1A10.50.100.1

D:\>type gr.txt | sort /+2 > grsrt.txt

D:\>type grsrt.txt
> ls -t groceryshoppin.com
bruceleeA10.50.100.3
u-1A10.50.100.1
groceryshoppin.com.NSserver = wormy.groceryshoppin.com
pooldogA10.50.100.22
wormyA10.50.100.25
[wormy.groceryshoppin.com]

D:\>type gr.txt | sort /+40 > grsrt.txt

D:\>type grsrt.txt
[wormy.groceryshoppin.com]
> ls -t groceryshoppin.com
u-1A10.50.100.1
pooldogA10.50.100.22
wormyA10.50.100.25
bruceleeA10.50.100.3
groceryshoppin.com.NSserver = wormy.groceryshoppin.com

D:\>

Note that the listing sorted by IP address has the typical alphanumeric sort problem where .11 will come before .2. I'm sure there are more elegant ways to do this, but this is simple, generic, and works out of the box.





Please read our Terms of Use
Microsoft, Windows, Windows XP, Windows 2003, Windows 2000, and NT are either trademarks or registered trademarks of Microsoft Corporation. NetAdminTools.com is not affiliated with Microsoft Corporation. Linux is a registered trademark of Linus Torvalds, and refers to the Linux kernel. The operating system of most distributions that contain the Linux kernel is GNU/Linux. All logos and trademarks in this site are property of their respective owner. Copyright 1997-2008 NetAdminTools.com