Tag Archives: powershell

Resist the urge to flush

Example DNS Client cache on Windows 8
Example DNS Client cache on Windows 8

Every IT guy eventually learns how to flush the local cache for a system’s DNS client. The following command has probably wore many a helpdesk or admin keyboard:

ipconfig /flushdns

There are certainly times where that is the best or only course of action in diagnostics or recovery. For instance, a replacement service may be running with a different IP address such as when a VM or service is moved from one Data Center to the other.

Sometimes the better course is to observe (passively) before any action is taken. Windows PowerShell offers a simple commandlet, Get-DnsClientCache that can be very helpful showing each entry of a host and other useful information such as record type, TTL and the IP addresses. Combine the basic command with some simple processing for more power (below):

PS C:\Users\User> Get-DnsClientCache | where entry -Contains youtu.be

Entry                     RecordName                Record Status    Section TimeTo Data   Data                                      
                                                    Type                     Live   Length                                           
-----                     ----------                ------ ------    ------- ------ ------ ----                                      
youtu.be                  youtu.be                  A      Success   Answer      58      4 74.125.225.104                            
youtu.be                  youtu.be                  A      Success   Answer      58      4 74.125.225.102                            
youtu.be                  youtu.be                  A      Success   Answer      58      4 74.125.225.101                            
youtu.be                  youtu.be                  A      Success   Answer      58      4 74.125.225.98                             
youtu.be                  youtu.be                  A      Success   Answer      58      4 74.125.225.97                             
youtu.be                  youtu.be                  A      Success   Answer      58      4 74.125.225.105                            
youtu.be                  youtu.be                  A      Success   Answer      58      4 74.125.225.99                             
youtu.be                  youtu.be                  A      Success   Answer      58      4 74.125.225.100                            
youtu.be                  youtu.be                  A      Success   Answer      58      4 74.125.225.103                            
youtu.be                  youtu.be                  A      Success   Answer      58      4 74.125.225.110                            
youtu.be                  youtu.be                  A      Success   Answer      58      4 74.125.225.96

 

Go ahead and try it out on your Windows system the next time you feel the urge to flush.

 

FacebookTwitterGoogle+LinkedInPinterestTumblrEvernoteWordPressShare

Poor Man’s IE Session Management

Perhaps I should call this post, “Lazy Man’s IE Session Management”.

On IE9 and IE10 I’ve always wanted a session manager. Well, until I find or make one, I’ll make do with the following PowerShell script:

Get-Process| where name -eq iexplore | foreach kill

or, the PowerShell-less .bat

taskkill /f /im iexplore.exe

 

When I relaunch IE, I can choose to immediately recovery the session or postpone and later start the recovery via the About:Tabs or Tools link.

For sessions that I regularly start,  a simple About:Tabs with my stock choices bring me to particular tasks/projects or workflows.

Now what I’d like to do for IE intensive loads is to create a script that will load X instances of IE, each window housing related tab but only loading under lower process priority and with a even watch to wait for prior tabs and window load completions…