<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>ドメイン on kenji.blog</title><link>http://kenji.blog/zh-tw/tags/%E3%83%89%E3%83%A1%E3%82%A4%E3%83%B3/</link><description>Recent content in ドメイン on kenji.blog</description><generator>Hugo -- gohugo.io</generator><language>zh-tw</language><copyright>kenjinote</copyright><lastBuildDate>Tue, 13 Sep 2022 01:16:40 +0900</lastBuildDate><atom:link href="http://kenji.blog/zh-tw/tags/%E3%83%89%E3%83%A1%E3%82%A4%E3%83%B3/index.xml" rel="self" type="application/rss+xml"/><item><title>如何在 Github 儲存庫中設定自訂網域</title><link>http://kenji.blog/zh-tw/p/%E5%A6%82%E4%BD%95%E5%9C%A8-github-%E5%84%B2%E5%AD%98%E5%BA%AB%E4%B8%AD%E8%A8%AD%E5%AE%9A%E8%87%AA%E8%A8%82%E7%B6%B2%E5%9F%9F/</link><pubDate>Tue, 13 Sep 2022 01:16:40 +0900</pubDate><guid>http://kenji.blog/zh-tw/p/%E5%A6%82%E4%BD%95%E5%9C%A8-github-%E5%84%B2%E5%AD%98%E5%BA%AB%E4%B8%AD%E8%A8%AD%E5%AE%9A%E8%87%AA%E8%A8%82%E7%B6%B2%E5%9F%9F/</guid><description>&lt;img src="http://kenji.blog/p/github%E3%83%AA%E3%83%9D%E3%82%B8%E3%83%88%E3%83%AA%E3%81%AB%E3%82%AB%E3%82%B9%E3%82%BF%E3%83%A0%E3%83%89%E3%83%A1%E3%82%A4%E3%83%B3%E3%82%92%E8%A8%AD%E5%AE%9A%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95/images/octocat.png" alt="Featured image of post 如何在 Github 儲存庫中設定自訂網域" />&lt;p>要為 Github 儲存庫設定自訂網域，您需要變更網域的 DNS 設定。
在此，我們將假設您使用 &lt;a href="https://px.a8.net/svt/ejp?a8mat=3TJBXA+BKRHS2+50+2HHVNM" rel="nofollow">Onamae.com&lt;/a> 管理您的網域。
&lt;img border="0" width="1" height="1" src="https://www19.a8.net/0.gif?a8mat=3TJBXA+BKRHS2+50+2HHVNM" alt="">
您可以透過在其他註冊商處覆寫 A 記錄來進行類似的設定。&lt;/p>
&lt;h2 id="在-onamaecom-中變更-dns-設定">在 Onamae.com 中變更 DNS 設定
&lt;/h2>&lt;p>要變更網域的 DNS 設定，請登入 &lt;a href="https://px.a8.net/svt/ejp?a8mat=3TJBXA+BKRHS2+50+2HHVNM" rel="nofollow">Onamae.com&lt;/a> 的管理畫面。
&lt;img border="0" width="1" height="1" src="https://www19.a8.net/0.gif?a8mat=3TJBXA+BKRHS2+50+2HHVNM" alt="">
登入後，請前往網域管理畫面。
進入網域管理畫面後，請變更 DNS 設定。
要變更 DNS 設定，請按照以下步驟進行：&lt;/p>
&lt;ol>
&lt;li>存取 &lt;a class="link" href="https://www.onamae.com/" target="_blank" rel="noopener"
>https://www.onamae.com/&lt;/a> 並點擊「Onamae.com Navi 登入」&lt;/li>
&lt;li>輸入您的「Onamae ID (會員 ID)」與「密碼」，然後點擊登入按鈕&lt;/li>
&lt;li>點擊「名稱伺服器設定」&lt;/li>
&lt;li>點擊「網域 DNS 設定」&lt;/li>
&lt;li>選擇您想設定的網域，然後點擊「下一步」&lt;/li>
&lt;li>點擊「使用 DNS 記錄設定」右側的「設定」&lt;/li>
&lt;li>在 TYPE 選擇 A，在 TTL 輸入 3600，在 VALUE 輸入「185.199.108.153」，然後點擊「新增」&lt;/li>
&lt;li>與步驟 7 相同，也為「185.199.109.153」、「185.199.110.153」和「185.199.111.153」進行新增&lt;/li>
&lt;li>確認已勾選「DNS 記錄設定用名稱伺服器變更確認」，然後點擊「前往設定畫面」&lt;/li>
&lt;li>如果出現「為了防止意外的 DNS 設定變更」畫面，請點擊「不設定」（請視需要選擇）&lt;/li>
&lt;li>確認設定內容，然後點擊「設定」
&lt;img src="http://kenji.blog/p/github%E3%83%AA%E3%83%9D%E3%82%B8%E3%83%88%E3%83%AA%E3%81%AB%E3%82%AB%E3%82%B9%E3%82%BF%E3%83%A0%E3%83%89%E3%83%A1%E3%82%A4%E3%83%B3%E3%82%92%E8%A8%AD%E5%AE%9A%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95/images/img.png"
width="656"
height="140"
srcset="http://kenji.blog/p/github%E3%83%AA%E3%83%9D%E3%82%B8%E3%83%88%E3%83%AA%E3%81%AB%E3%82%AB%E3%82%B9%E3%82%BF%E3%83%A0%E3%83%89%E3%83%A1%E3%82%A4%E3%83%B3%E3%82%92%E8%A8%AD%E5%AE%9A%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95/images/img_hu4809a0e7ac5f7d8dfe8c6643786c9385_7354_480x0_resize_box_3.png 480w, http://kenji.blog/p/github%E3%83%AA%E3%83%9D%E3%82%B8%E3%83%88%E3%83%AA%E3%81%AB%E3%82%AB%E3%82%B9%E3%82%BF%E3%83%A0%E3%83%89%E3%83%A1%E3%82%A4%E3%83%B3%E3%82%92%E8%A8%AD%E5%AE%9A%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95/images/img_hu4809a0e7ac5f7d8dfe8c6643786c9385_7354_1024x0_resize_box_3.png 1024w"
loading="lazy"
alt="img.png"
class="gallery-image"
data-flex-grow="468"
data-flex-basis="1124px"
>&lt;/li>
&lt;li>這樣 DNS 設定就完成了。最多可能需要約 72 小時才能完成生效。&lt;/li>
&lt;li>如果 72 小時後仍未生效，請嘗試聯絡 Onamae.com 的支援團隊。&lt;/li>
&lt;/ol>
&lt;p>要確認設定是否已反映在您的本機環境中，請嘗試執行以下命令。
請將 &lt;code>example.com&lt;/code> 替換為您想確認的網域。&lt;/p>
&lt;h3 id="適用於-linuxmac">適用於 Linux、Mac
&lt;/h3>&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">dig example.com +noall +answer -t A
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>如果結果如下，則表示設定已反映。&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;span class="lnt">3
&lt;/span>&lt;span class="lnt">4
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">example.com. &lt;span class="m">0&lt;/span> IN A 185.199.108.153
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">example.com. &lt;span class="m">0&lt;/span> IN A 185.199.109.153
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">example.com. &lt;span class="m">0&lt;/span> IN A 185.199.110.153
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">example.com. &lt;span class="m">0&lt;/span> IN A 185.199.111.153
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;h3 id="適用於-windows">適用於 Windows
&lt;/h3>&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">nslookup -q&lt;span class="o">=&lt;/span>a example.com 8.8.8.8
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>如果結果如下，則表示設定已反映。&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;span class="lnt">3
&lt;/span>&lt;span class="lnt">4
&lt;/span>&lt;span class="lnt">5
&lt;/span>&lt;span class="lnt">6
&lt;/span>&lt;span class="lnt">7
&lt;/span>&lt;span class="lnt">8
&lt;/span>&lt;span class="lnt">9
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">伺服器: dns.google
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">Address: 8.8.8.8
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">未授權的回答:
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">名稱: example.com
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">Addresses: 185.199.108.153
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> 185.199.109.153
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> 185.199.110.153
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> 185.199.111.153
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;h2 id="在-github-儲存庫中設定自訂網域">在 Github 儲存庫中設定自訂網域
&lt;/h2>&lt;ol>
&lt;li>打開儲存庫頁面，然後點擊 Settings&lt;/li>
&lt;li>點擊 Pages&lt;/li>
&lt;li>如果您要直接發佈儲存庫的原始碼，請在 Source 中選擇「Deploy from a branch」。如果您要建置原始碼（如 HUGO），請選擇「GitHub Actions」。&lt;/li>
&lt;li>在 Branch 中選擇要發佈的分支，然後點擊 Save&lt;/li>
&lt;li>在 Custom domain 中輸入您取得的網域，然後點擊 Save。&lt;/li>
&lt;li>如果需要，請勾選「Enforce HTTPS」以啟用 HTTPS 支援&lt;/li>
&lt;/ol>
&lt;p>[PR]
&lt;a href="https://px.a8.net/svt/ejp?a8mat=3TJBXA+BKRHS2+50+2HQGAP" rel="nofollow">
&lt;img border="0" width="468" height="60" alt="" src="https://www24.a8.net/svt/bgt?aid=231009310700&amp;wid=003&amp;eno=01&amp;mid=s00000000018015072000&amp;mc=1">&lt;/a>
&lt;img border="0" width="1" height="1" src="https://www14.a8.net/0.gif?a8mat=3TJBXA+BKRHS2+50+2HQGAP" alt="">&lt;/p></description></item></channel></rss>