Skip to main content
XsiSec.com
HomeReposBlogProjectsPortfolio
© 2026 XsiSec.com
Security rules |security.txt
Updated 2026-08-15 · v1.0.0+2026-08-14.82f92cb · 82f92cb
← Back to overview
Security article

HTB Academy - DNS

HTB Academy - DNS: DNS • HTB Academy • dns, htb-academy

2022-09-302 tags
Tags

DNS

Active Directory Domain Services (AD DS) uses DNS to let clients (workstations, servers, and other domain‑joined systems) locate Domain Controllers and for DC‑to‑DC communication. DNS resolves hostnames to IP addresses and is used across internal networks and the internet. Private networks use AD DNS namespaces to coordinate communications between servers, clients, and peers.

AD maintains a database of services in the form of SRV records. These records let clients locate services they need (Domain Controllers, file servers, printers, etc.). Dynamic DNS automatically updates the DNS database when a system’s IP changes—doing this by hand would be error‑prone and time‑consuming. If DNS doesn’t have the correct IP for a host, clients won’t find or reach it.

When a client joins the network, it finds a DC by querying DNS for an appropriate SRV record, gets the DC’s hostname, and then resolves that hostname to an IP address.

Ports: DNS uses UDP/53 by default and TCP/53 when needed (e.g., larger messages, zone transfers, EDNS0 > 512 bytes).


🎯 What I check/remember

  • SRV records drive DC discovery (e.g., _ldap._tcp.dc._msdcs.<domain>).
  • Clients must use AD DNS (not public resolvers).
  • Dynamic updates keep A/PTR records fresh; stale records break logons/GPOs.
  • If name resolution flaps, expect Kerberos/GPO issues to follow.

🔎 Finding the IP of a host

We can query by short name or FQDN; the DC’s resolver will answer either way if search suffixes are configured:

powershell
PS C:\htb> nslookup ACADEMY-EA-DC01
Server:  172.16.6.5
Address: 172.16.6.5

Name:    ACADEMY-EA-DC01.INLANEFREIGHT.LOCAL
Address: 172.16.6.5

SRV lookups (interactive nslookup)

text
> nslookup
> set type=SRV
> _ldap._tcp.dc._msdcs.INLANEFREIGHT.LOCAL
> _kerberos._tcp.INLANEFREIGHT.LOCAL

PowerShell alternatives

powershell
Resolve-DnsName INLANEFREIGHT.LOCAL
Resolve-DnsName _ldap._tcp.dc._msdcs.INLANEFREIGHT.LOCAL -Type SRV
Resolve-DnsName ACADEMY-EA-DC01.INLANEFREIGHT.LOCAL

📎 Quick crib (copy‑paste)

powershell
# Forward lookup
nslookup ACADEMY-EA-DC01

# Reverse lookup
nslookup 172.16.6.5

# SRV discovery for DCs (interactive)
nslookup
> set type=SRV
> _ldap._tcp.dc._msdcs.INLANEFREIGHT.LOCAL
powershell
# PowerShell one‑liners
Resolve-DnsName INLANEFREIGHT.LOCAL
Resolve-DnsName _kerberos._tcp.INLANEFREIGHT.LOCAL -Type SRV

🧪 Troubleshooting

  • Client uses wrong DNS → Point to AD DNS only. Public resolvers won’t know your AD zones.
  • Stale A/PTR → Enable scavenging; run ipconfig /registerdns; clear client cache (ipconfig /flushdns).
  • SRV missing/broken → Verify DCs register services; check Netlogon/DNS health (nltest /dsregdns).
  • Large responses failing → Ensure TCP/53 isn’t filtered; verify EDNS0 handling on network devices.
  • Split‑brain/multiple views → Confirm zone authority and replication scope match your design.

📚 Further study

  • HTB Academy: DNS Enumeration Using Python
  • HTB Academy: Information Gathering – Web Edition (DNS section)
Navigate

In this post

  1. 01DNS
  2. 02🎯 What I check/remember
  3. 03🔎 Finding the IP of a host
  4. 04📎 Quick crib (copy‑paste)
  5. 05🧪 Troubleshooting
  6. 06📚 Further study
Search
Explore

Popular tags

Browse all 30 tags

Comments

0 comments

No comments yet — be the first to comment.