← All articles

DNS Hijacking Can Redirect Websites and Intercept Email

DNS Hijacking Can Redirect Websites and Intercept Email

DNS changes can redirect visitors, disrupt email and expose a domain even when the website files on its server remain clean. DNS, or Domain Name System, translates a domain name into the IP address of the server that should answer for it. Because DNS is controlled through a registrar and DNS provider, rather than the web server itself, changing one record can send visitors elsewhere without altering anything a traditional malware scan checks.

The most serious examples include an altered A record, which points a hostname to an IPv4 address, or an AAAA record, which does the same for IPv6. Visitors could be sent to a phishing page, a malicious download or a fraudulent website while the real site continues to look normal. An attacker who changes MX records, the entries that identify servers handling email, could redirect incoming messages and password reset links. TXT records can contain email controls such as SPF and DMARC, as well as verification strings. Changing them could authorise another sender, weaken email protection or let an outsider claim the domain in a third-party service.

Attackers may also create or redirect subdomains for phishing. Such activity can damage a domain’s reputation, cause blocklisting and trigger security warnings. DNS control can also help an attacker obtain a valid TLS certificate, the certificate used to encrypt and authenticate a website connection, making a fraudulent site appear more trustworthy. CAA records limit which certificate authorities may issue certificates for a domain, so removing one or adding an unfamiliar authority is a warning sign.

The first practical measure is a dated DNS baseline, meaning a saved copy of the correct records kept outside the DNS control panel. Start with the main domain and www, then include every subdomain in use, such as mail, shop, staging, API and CDN hostnames. Record A, AAAA, CNAME, NS, MX, TXT and CAA values, along with their TTL settings. A CNAME is an alias from one hostname to another, while NS records identify the nameservers that control the whole DNS zone. A new or unfamiliar CNAME, unknown IP address, unexpected mail host, weakened DMARC policy or added certificate authority can indicate tampering. A sharply increased TTL, which controls how long resolvers cache an answer, can make a bad change remain in caches for longer.

The registrar account needs its own baseline. Save the domain’s nameservers, contact email address, transfer lock status and expiry date in a dated plain text file stored in version control or a password manager. The transfer lock helps prevent unauthorised domain movement, while nameserver changes are especially serious because they can hand control of the entire zone to another DNS service.

Monitoring can begin with manual checks using dig on macOS or Linux, or nslookup on Windows. Queries can check A, MX, NS and TXT records, and should use more than one resolver because cached answers may differ while a change spreads. A lookup can also be sent directly to an authoritative nameserver, the server responsible for the domain’s official answers, to avoid relying on another resolver’s cache. For ongoing checking, a scheduled script can collect the same records, sort the results and compare them with the saved baseline. The example approach runs hourly from cron, a system scheduler, and emails a difference report after a change. It should run from a machine separate from the web server, and alerts should go to an address that does not rely on the domain’s MX records, otherwise an email hijack could disable the warning system. After an approved change, review the difference and save the current records as the new baseline.

Provider and registrar notifications add information that a record comparison cannot provide. These alerts may report edited records, API token use or transfer requests, and audit logs may show which account made a change and when. Certificate Transparency logs provide another layer: publicly trusted certificates are recorded in searchable public logs, so monitoring a domain can reveal an unexpected certificate even if the DNS record used to obtain it has already been removed. DNS monitoring should complement file integrity monitoring, which detects changes to files on disk, and uptime monitoring, which checks whether visitors can reach the site.

Warning signs include visitors reporting unfamiliar redirects while the site appears normal to the owner, email that stops arriving, bounce messages naming unknown mail servers, unexpected SPF or DMARC failures, unknown subdomains in certificate alerts or search results, blocklist or malware warnings despite clean website scans, and nameservers at the registrar that no longer match the DNS provider. Compare the current records with the baseline and inspect registrar and provider audit logs as soon as any of these appear.

When a change is unexpected, first confirm it from a second resolver and the authoritative nameserver. Check the audit logs before assuming an attack, since a colleague or agency may have made a legitimate edit. Preserve evidence by saving query output, the monitoring diff, audit entries, screenshots and timestamps. Then restore the baseline value. If delegation changed, correct the nameservers at the registrar first, because changes inside the old DNS panel will not reach visitors until delegation is restored.

Lower the TTL on corrected records so later fixes can propagate faster, but expect a delay while caches holding the bad answer expire. Rotate credentials for the registrar, DNS provider, reseller and hosting panel, remove users and tokens that cannot be explained, enable two-factor authentication and restore the registrar transfer lock. If MX or SPF records were affected, reset passwords for accounts whose reset messages may have been intercepted and warn staff that email from the affected period may have been read.

Review certificate logs and ask the issuing certificate authority to revoke certificates that were not requested. Publish a CAA record naming the certificate authorities actually used. Also inspect the website itself, because the same stolen credentials may provide both DNS and server access. Run a full scan and compare files with a known-good copy, then save the corrected DNS records as a new dated baseline. If customer data or email contents were exposed, notification duties depend on where customers are, so the organisation responsible for that decision should be involved early.

Prevention combines account security and regular review. Use strong passwords, two-factor authentication and limited access, keep the transfer lock enabled, and consider a registry lock for additional protection. Remove outdated records, especially CNAME entries for services no longer in use. DNSSEC, or Domain Name System Security Extensions, can help protect against forged DNS responses, but it does not stop someone with authorised account access from changing DNS settings.

Also available in: DeutschItalianoShqip