# GitHub Pages 自訂域名被導到垃圾網站 > [time=Feb 2, 2025] 去年在 [porkbun](https://porkbun.com/) 上註冊了一個 domain `sumiaur.com`,並設定了 subdomain 會連到架設在 [GitHub Pages](https://pages.github.com/) 上的網站。最近不知道為什麼心血來潮,嘗試連 `sumiaur.com` 或 `www.sumiaur.com` 時發現居然會連到不知名的賭博網站,讓我嚇了一跳。 一開始我以為是 porkbun 那邊有問題,還寫信去跟他們客服反應,客服回應說可能是 GitHub 那邊有問題,所以我就去看了一下 [GitHub 的官方文件](https://docs.github.com/en/pages/configuring-a-custom-domain-for-your-github-pages-site/managing-a-custom-domain-for-your-github-pages-site),發現了下面這段提醒: > [!Tip] > We recommend verifying your custom domain prior to adding it to your repository, in order to improve security and avoid takeover attacks. For more information, see [Verifying your custom domain for GitHub Pages](https://docs.github.com/en/pages/configuring-a-custom-domain-for-your-github-pages-site/verifying-your-custom-domain-for-github-pages). 於是我就到設定中認證完域名,結果問題就解決了,原來是因為「[Subdomain takeovers](https://developer.mozilla.org/en-US/docs/Web/Security/Subdomain_takeovers)」才會造成這個問題,網路上也有很多掃描的工具像是「[Can I take over XYZ?](https://github.com/EdOverflow/can-i-take-over-xyz)」。 經過這次的教訓學到了一課,同時也體會到閱讀官方文件的重要性,以後要乖乖看文件才能降低錯誤的發生機率。