Blog O' Matty


Managing and debugging DNS on your Windows XP/Vista/7 clients

This article was posted by Matty on 2011-02-07 23:24:00 -0400 -0400

Microsoft Windows has all kinds of tools buried throughout the Windows directory. Several of these tools allow you to display and debug DNS and IP issues, which can be handy when you get a call from a customer that they can’t access your systems. If you need to display all of the entries your Windows host is caching, you can open cmd.exe and run the ipconfig utility with the “/displaydns” option:

C:\ ipconfig /displaydns

Windows IP Configuration

1.0.0.127.in-addr.arpa
----------------------------------------
Record Name . . . . . : 1.0.0.127.in-addr.arpa.
Record Type . . . . . : 12
Time To Live . . . . : 84375
Data Length . . . . . : 4
Section . . . . . . . : Answer
PTR Record . . . . . : localhost


google.com
----------------------------------------
Record Name . . . . . : google.com
Record Type . . . . . : 1
Time To Live . . . . : 143
Data Length . . . . . : 4
Section . . . . . . . : Answer
A (Host) Record . . . : 74.125.45.147

To flush the cached DNS settings you can run ipconfig with the “/flushdns” setting:

C:\ ipconfig /flushdns

Windows IP Configuration

Successfully flushed the DNS Resolver Cache.

If your host is configured to register it’s name dynamically with DNS, you can use the the “/registerdns” option to register your host with DNS and to refresh your DHCP lease:

C:\ ipconfig /registerdns

In a follow up post I will discuss Microsoft’s DNS server and some tools you can use to debug it.

Using dnscap to debug DNS problems on Linux hosts

This article was posted by Matty on 2011-01-26 14:30:00 -0400 -0400

DNS can often make a SysAdmins life difficult, since a misconfigured entry or a broken authoritative DNS server will cause things to fail in odd ways. If you are fortunate enough to use Linux on your servers and desktops, you have a slew of utilities available to look at problems. I’ve discussed a few of my favorite DNS debugging utilities in past posts, and recently added the dnscap utility to this list.

Dnscap is a command line utility that allows you to view ALL of the DNS requests sent over an interface in a dig-like or binary format. While tcpdump and company display traffic to UDP and TCP port 53, dnscap will actually decode the entries and give you everything you need to debug an issue in one place.

To use this super useful tool you can run it with the “-i” option, the interface to monitor along with the -g (dump the output in dig format) or “-b” (dump the output in binary) options:

$ dnscap -i eth0 -g

;@ 2011-01-26 16:33:21.892326 - 56 octets via eth0 (msg #0)
;: [192.168.144.91]:56239 -> [192.168.86.2]:53
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 62131
;; flags: rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;; google.com, type = A, class = IN
--
;@ 2011-01-26 16:33:21.896426 - 240 octets via eth0 (msg #1)
;: [192.168.86.2]:53 -> [192.168.144.91]:56239
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 62131
;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 4, ADDITIONAL: 4
;; google.com, type = A, class = IN
google.com. 1m31s IN A 74.125.157.99
google.com. 1m31s IN A 74.125.157.104
google.com. 1m31s IN A 74.125.157.147
google.com. 1d6h57m32s IN NS ns2.google.com.
google.com. 1d6h57m32s IN NS ns3.google.com.
google.com. 1d6h57m32s IN NS ns4.google.com.
google.com. 1d6h57m32s IN NS ns1.google.com.
ns1.google.com. 1d6h51m10s IN A 216.239.32.10
ns2.google.com. 1d6h51m10s IN A 216.239.34.10

The utility will then display all of the DNS requests on your console, and you can review the detailed request / SOA data along with the record information. This is extremely handy for debugging problems, and I’m glad I came across this awesome little utility!

Thoughts on building your own NAS device

This article was posted by Matty on 2011-01-20 13:34:00 -0400 -0400

In a previous post I shared the research I did on the various NAS solutions that are available. I’ve been experimenting with the software solutions I described in that post, and have decided to forego a pre-built solution in favor of a DIY project. There were a couple of reasons for this:

  1. The hardware costs were significantly less than the pre built solutions.
  2. I have quite a bit more flexibility rolling my own box.
  3. The commercial solutions come with a ton of bells and whistles that I don’t really need.
  4. There are functional streaming solutions that run on top of Linux and FreeBSD.
  5. I don’t have to worry about my NAS being EOL’ed or the company that sells it going under.

I’m not sure if I’m going to run FreeNSD or openfiler, but I have settled on my hardware. Based on a recommendation from a reader named Dave, I ordered a HP micro server along with 4 2TB Samsung disk drives. The server cost me $300, and I got the disk drives on sale for $80 each. That puts the total price tag for a NAS device with 8TB of RAW disk at just over $600. Not bad! I’m planning to do a thorough evaluation of freenas and openfiler, and will post my thoughts on the two as I start digging into them further. Also planning to do some serious performance benchmarks to see which performs better. Viva la NAS!!

Part two of this series is available here.

Making sense of the various NAS hardware and software solutions

This article was posted by Matty on 2011-01-13 13:47:00 -0400 -0400

This past weekend I realized I had a sufficient need at home for some type of centralized storage solution. Ideally this solution would allow me access my data from all of my machines via NFS, CIFS and iSCSI, and have some capabilities to stream music and videos across my wireless network. The number of NAS solutions I found astounded me, and I have been digging through reviews to see what is good.

During my research, I came across a slew of hardware and software solutions. The hardware solutions I added to my list came from various vendors, though I decided to scratch one large vendor (Drobo) after reading Curtis Preson’s blog post about his drobo support experience. Here are the hardware vendors that made it into my possibility list:

In addition to pre-built hardware, I also debated buying a low power system and running one of the following software NAS solutions on it:

Once I had a better feel for what was out there, I decided to pull out my notebook and write down the things that I wanted vs. needed in a NAS device. Here are the items I really wanted to have out of the box:

The synology devices seem to provide everything I’m after and then some, but the FreeNAS and openfiler projects provide a lot of flexibility that can’t be matched by the Synology (e.g., all the source is available). I’m currently leaning towards the Synology DS411J, but I may end up nixing that idea and build a small quiet machine that runs openfiler/freenas. If you have a centralized NAS device at home that meets the checklist above, please let me know in the comments.

A walk down DOS memory lane

This article was posted by Matty on 2011-01-12 13:21:00 -0400 -0400

This past weekend I started cleaning out a ton of old stuff. Like most geeks, I hate to get rid of things that may one day be useful. While reviewing the contents of one of my tech tubs, I came across some nostalgic DOS software and books from the early 90s. The first item was a stack of old software, which included Turbo Pascal, Turbo Assembler, Turbo C++, System Commander and DOS 6.22 on 1.44” floppy disks:

null

I also uncovered my good old DOS beyond 640K book:

null

Ahhhhh – this led me down memory lane. DOS was the first OS I used, and was were I originally learned assembly language. I recall vividly the nights of staying up until 5am writing my first TSR program and debugging assembly code. Back in those days there was no google, only IRC and a debugger. :) Looking back on it, DOS and the Borland editors were a blast to use!