> ## Content Index
> Fetch the complete content index at: https://www.filipkonopik.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# PowerShell: Get DNS Server Address
- URL: https://www.filipkonopik.com/powershell-get-dns-server-address/
- Published: 2026-07-26T08:50:25.000Z
- Updated: 2026-08-06T05:34:26.000Z
- Author: Filip Konopík
- Tags: Connectivity

Need to check which DNS server a machine is using - for network troubleshooting, confirming DHCP configuration, or verifying a custom DNS setup? This one-liner pulls it straight from the system.

Prerequisites:

- Privileges: None
- Module: Built-in, no import needed

Quick Command:

```Powershell
Get-DnsClientServerAddress -AddressFamily IPv4 | Where-Object { $_.InterfaceAlias -notlike "*Loopback*" } | Select-Object InterfaceAlias, ServerAddresses
```

Example Output:

```Powershell
InterfaceAlias ServerAddresses
-------------- ---------------
Ethernet       {10.211.55.1}
```

📦

****Want all of them at once?**  
Get every free one-liner from this blog in a single downloadable bundle organized by category, each with full comment-based help. No more copy-pasting one at a time.

[Get the Complete Bundle for $39](https://gum.co/u/oczvkqdc?ref=filipkonopik.com)

How It Works:

- Get-DnsClientServerAddress returns the configured DNS servers for every network adapter, across both IPv4 and IPv6 - by default this includes the loopback interface and empty entries, which aren't useful for a quick check.
- \-AddressFamily IPv4 filters down to only IPv4 DNS entries.
- Where-Object { $\_.InterfaceAlias -notlike "\*Loopback\*" } excludes the loopback interface, keeping only the real network adapter.
- Select-Object InterfaceAlias, ServerAddresses trims the output down to just the adapter name and its configured DNS server(s).