Latest Updates: tips

  • Using dig to Query a Specific DNS Server (Name Server) Directly (Linux, BSD, OSX)

    16:54 on August 12, 2011 | 0 Comments Tweet This! | Digg This!
    Tags: , , , , tips

    There may be occasions when you wish to query a DNS server directly.  I often do it before changing DNS servers for a domain; I’ll setup the new records on the new DNS servers, and then query them directly to ensure they are returning the correct records.

    I recommend that anyone running DNS services for any domain looks into these commands – they’re very useful, especially when you’re making changes.

    dig has a feature which allows you to specify a name server along with the record you want to query.

    For example, one of the DNS servers for droptips.com is “ns.123-reg.co.uk”.  We can query this server directly, for the www record by doing the following:

    $ dig droptips.com @ns.123-reg.co.uk

    You’ll get some output with a section titled Answer Section:

    ;; ANSWER SECTION:
     droptips.com.       86400   IN      A       89.238.134.5

    This details the result (89.238.134.5) and also the TTL for the record (in seconds).  The TTL is important, as this is how long caching DNS servers should cache the result for – in this case, 86400 seconds which is 1 day. Using this command to find out a TTL value for a particular record is also quite useful, especially if you’re investigating DNS cache issues.

    You can also do the same to check other records such as MX records, by simpling adding the record type to the command.  For example, to get the MX records ns1.google.com is reporting for google.co.uk:

    $ dig MX google.co.uk @ns1.google.com

    … with the results:

    ;; ANSWER SECTION:
     google.co.uk.           10800   IN      MX      10 google.com.s9a2.psmtp.com.
     google.co.uk.           10800   IN      MX      10 google.com.s9b1.psmtp.com.
     google.co.uk.           10800   IN      MX      10 google.com.s9b2.psmtp.com.
     google.co.uk.           10800   IN      MX      10 google.com.s9a1.psmtp.com.

    You can see in this instance, that the TTL is 10800 seconds which is 3 hours, and all MX records have the same priority level of 10.

     
  • When Did You Last Reboot Your Microsoft Windows 7 Machine? (Check Uptime)

    13:50 on June 5, 2010 | 0 Comments Tweet This! | Digg This!
    Tags: tips,

    Finding out when you last rebooted your Windows 7 machine can be completed using the “systeminfo” command.

    Open a Command Prompt by going to Start and opening “cmd”. You will then be presented with a command prompt window, where you need to type the systeminfo command below:

    C:\> systeminfo | find "System Boot Time"
    System Boot Time:          05/06/2010, 12:55:07

    You will then be shown the date and time the server was booted (as seen in the example above).

    You can just run “systeminfo” on it’s own (with no ‘| find “System Boot Time”‘), and you will be presented with a lot of other information such as Hotfixes, Network Connections, etc.

     
  • Installing the Telnet Client on Windows 2008 using a Command Prompt

    22:47 on June 2, 2010 | 0 Comments Tweet This! | Digg This!
    Tags: tips,

    Like Windows 7 and Windows Vista, the Telnet client isn’t installed by default.

    In Windows Server 2008, you can install it via the Server Manager GUI tool, but it is often quicker to install it via a command prompt/terminal.

    So, open a cmd.exe session and run the following:

    servermanagercmd -install telnet-client

    And that’s it – once the command has completed, telnet.exe will be available from a command prompt.