Tag: DNS

Flush DNS Cache with PowerShell

Flush DNS Cache with PowerShell

Awhile ago I wrote a blog post called PowerShell Networking Cheat sheet, where I put together several networking commands which can be replaced by PowerShell. One of the latest once I saw and a couple of people requested is how you flush the DNS cache using PowerShell. This would allow you to replace ipconfig/ flushdns with PowerShell. Guess what, Microsoft as now a PowerShell cmdlet for that.

Clear and Flush DNS with PowerShell

You can use the following command to clear the DNS cache on a Windows system using PowerShell

Show DNS Cache with PowerShell

There is also a PowerShell command to show you the DNS cache:

I hope this blog post and these commands are useful.



Get-NetIPConfiguration

Basic Networking PowerShell cmdlets cheatsheet to replace netsh, ipconfig, nslookup and more

Around 4 years ago I wrote a blog post about how to Replace netsh with Windows PowerShell which includes basic powershell networking cmdlets. After working with Microsoft Azure, Nano Server and Containers, PowerShell together with networking becomes more and more important. I created this little cheat sheet so it becomes easy for people to get started.

Basic Networking PowerShell cmdlets

Get-NetIPConfiguration

Get the IP Configuration (ipconfig with PowerShell)

List all Network Adapters

Get a spesific network adapter by name

Get more information VLAN ID, Speed, Connection status

Get driver information

Get adapter hardware information. This can be really usefull when you need to know the PCI slot of the NIC.

Disable and Enable a Network Adapter

Rename a Network Adapter

IP Configuration using PowerShell

PowerShell Networking Get-NetIPAddress

Get IP and DNS address information

Get IP address only

Get DNS Server Address information

Set IP Address

or if you want to change a existing IP Address

Remove IP Address

Set DNS Server

Set interface to DHCP

Clear DNS Cache with PowerShell

You can also manage your DNS cache with PowerShell.

List DNS Cache:

Clear DNS Cache

Ping with PowerShell

PowerShell Networking Test-NetConnection Ping

How to Ping with PowerShell. For a simple ping command with PowerShell, you can use the Test-Connection cmdlet:

There is an advanced way to test connection using PowerShell

Get some more details from the Test-NetConnection

Ping multiple IP using PowerShell

Tracert

PowerShell Tracert

Tracert with PowerShell

Portscan with PowerShell

PowerShell Portscan

Use PowerShell to check for open port

NSlookup in PowerShell

PowerShell Networking NSlookup

NSlookup using PowerShell:

Route in PowerShell

PowerShell Networking Route

How to replace Route command with PowerShell

NETSTAT in PowerShell

PowerShell Networking Netstat

How to replace NETSTAT with PowerShell

NIC Teaming PowerShell commands

Create a new NIC Teaming (Network Adapter Team)

SMB Related PowerShell commands

SMB PowerShell SMB Client Configuration

Get SMB Client Configuration

Get SMB Connections

Get SMB Mutlichannel Connections

Get SMB open files

Get SMB Direct (RDMA) adapters

Hyper-V Networking cmdlets

Hyper-V PowerShell Get-VMNetwork Adapter

Get and set Network Adapter VMQ settings

Get VM Network Adapter

Get VM Network Adapter IP Addresses

Get VM Network Adapter Mac Addresses

I hope you enjoyed it and the post was helpful, if you think something important is missing, please add it in the comments.



Create a DNS Entry for Exchange Autodiscover

Exchange

This is a small post how you can create the DNS records for Exchange Autodiscover in the Genotec Hosting Control Panel.

  1. First login to the HCC (Hosting Control Center).
  2. Navigate to Domainnames and choose your domain
  3. (OPTIONAL) If you not already have, create a new A record for your mailserver (for example mail.the-it-crowd.ch)
    A Record
  4. (OPTIONAL) If you not already create a MX record for your domain, create a MX record
    MX record
  5. Create a CNAME for your autodiscover domain. Normally this is pointing to your mailserver. You could also use the allready exisiting mail.the-it-crowd.ch A record. But I would recommend you to create this CNAME.
    CNAME
  6. Create the Autodiscover SRV record
    TYP: SRV HOST: _autodiscover._tcp.the-it-crowd.ch. DATA:
    0 0 443 autodiscover.the-it-crowd.ch.
    SRV


Office 365 – Verify domain hosted at Genotec

office365

You can add your own Domain to your Office 365 account. If your domain is hosted at Genotec, you can simply create the DNS records for your domain with the DNS editor Genotec provides in the Hosting Control Center.

Under Domainnames, yourdomainname.com you can create a new TXT entry to verify your domain. For example:

Office 365 Verify Domain Name Genotec

After you have verifyed your Domain you have to add some other DNS Records for Exchange and Lync Online to work.

Here the DNS records for Exchange Online:

Office 365 Genotec Exchange Online Records

Office 365 Genotec Exchange Online Records

Office 365 Genotec Exchange Online Records

 

And here the DNS Records for Lync Online:

Office 365 Genotec Lync Online Records

Office 365 Genotec Lync Online Records

Remember to add the dot at the end of hostnames.

 

 



Office 365 important DNS knowledge

office365

Last week Microsoft launched Office 365. Office365 is clearly a great product. Microsoft offers three different “plans”. One is for small businesses, Plan P, maybe stands for Professional or Personal. Plan P is a offer for small businesses with less than 26 users. For bigger companies or Enterprises Microsoft offers Plan E (Enterprise) which also includes Plan K (kiosk workers).

Now there are a lot of differences between this plans which are described on the Office365 website. But there is something I just realized after I used Office 365 the first time. If you want to use Office 365 with your own domain, Microsoft has two ways to do this.

With Plan P you have to delegate all the DNS configuration to Microsofts DNS servers, which means your DNS servers for your domain, will be somednsserver.microsoft.com. Microsoft offers you a simple UI to create additional CNAME and A records. And all your MX records and A records which are used by Office 365 will be created automatically. This makes it very easy, but even for some small businesses this does not work, because they may need more than just some simple additional A records or CNAMEs.

If you wanna use your own DNS servers or the DNS servers of your provider, you have to use one of the Enterprise plans (there are more than one plan). With a Plan E1 for example, you can choose to delegate all the DNS administration to the Microsoft DNS servers or you can choose your own, maybe already existing public DNS servers. In this case Microsoft tells you which DNS records you need to create (MX, TXT and A records).



Quick nslookup Guide

nslookup help

This is a quick note how to use nslookup.exe.

Start nslookup and check for domain

Change Nameserver for search querys

Set a query type (ex. A,AAAA,A+AAAA,ANY,CNAME,MX,NS,PTR,SOA,SRV)

nslookup.exe help



How to add a Windows Server 2008 R2 Core as Secondary DNS Server

This shows you how you can add a secondary DNS Server to your Network on a Windows Server 2008 R2 Core.

  1. As usual you configure the Windows Server 2008 R2 Core with Sconfig
  2. Now install the DNS Server role on the Windows Server 2008 R2 Core
    Windows Server 2008 R2 Core DNS Serverstart /w ocsetup DNS-Server-Core-Role
  3. On the primary DNS Server open the DNS Server MMC
  4. Right click properties on the DNS zones you wanna transfer to the new core server
  5. Add the new DNS Server in the Name Server Tab. In this case this is server04.corp.pepsi.local
    Windows Server 2008 R2 DNS Server
  6. Allow Zone Transfers to this Server or Server in the Name Servers Tab
    Windows Server 2008 R2 DNS Server