新增 DNS 記錄以連接您的網域Add DNS records to connect your domain

如果您是從協力廠商主機服務提供者購買網域,您可以更新註冊機構帳戶中的 DNS 記錄,將它連線到 Microsoft 365。If you purchased a domain from a third-party hosting provider, you can connect it to Microsoft 365 by updating the DNS records in your registrar’s account.

在這些步驟結束時,您的網域將會在您購買網域的主機中持續註冊,但 Microsoft 365 可以將它用於您的電子郵件地址 (例如 user@yourdomain.com) 和其他服務。At the end of these steps, your domain will stay registered with the host that you purchased the domain from, but Microsoft 365 can use it for your email addresses (like user@yourdomain.com) and other services.

如果您沒有新增網域,貴組織中的人員將會使用 onmicrosoft.com 網域的電子郵件地址,直到您新增網域為止。If you don't add a domain, people in your organization will use the onmicrosoft.com domain for their email addresses until you do. 新增使用者之前,請務必先新增您的網域,這樣您就不需要再設定一次。It's important to add your domain before you add users, so you don't have to set them up twice.

若您在下方找不到所需內容,請查看網域常見問題集Check the Domains FAQ if you don't find what you're looking for below.

步驟 1: 新增 TXT 或 MX 記錄以驗證您擁有該網域Step 1: Add a TXT or MX record to verify you own the domain

首先,您必須證明您擁有要新增至 Microsoft 365 的網域。First, you need to prove you own the domain you want to add to Microsoft 365.

  1. 登入 Microsoft 365 系統管理中心,然後選取 [顯示所有] > [設定] > [網域]Sign in to the Microsoft 365 admin center and select Show all > Settings > Domains.
  2. 在新的瀏覽器索引標籤或視窗中,登入您的 DNS 主機服務提供者,然後尋找您管理 DNS 設定的位置(例如 [區域檔案設定]、[管理網域]、[網域管理員]、[DNS 管理員])。In a new browser tab or window, sign in to your DNS hosting provider, and then find where you manage your DNS settings (e.g., Zone File Settings, Manage Domains, Domain Manager, DNS Manager).
  3. 移至您提供者的 [DNS 管理員] 頁面,並將系統管理中心所指出的 TXT 記錄新增到您的網域。Go to your provider's DNS Manager page, and add the TXT record indicated in the admin center to your domain.

新增此記錄不會影響您現有的電子郵件或其他服務,您只要將網域連線至 Microsoft 365,就能安全地將它移除。Adding this record won't affect your existing email or other services and you can safely remove it once your domain is connected to Microsoft 365.

範例:Example:

  • TXT 名稱: @TXT Name: @
  • TXT 值: MS = ms # # # # # # # # ([系統管理中心] 的唯一識別碼)TXT Value: MS=ms######## (unique ID from the admin center)
  • TTL: 3600‎ (或您的提供者預設值)TTL: 3600‎ (or your provider default)
  1. 儲存記錄、返回系統管理中心,然後選取 [驗證]Save the record, go back to the admin center, and then select Verify. 註冊記錄變更通常需要15分鐘的時間,但是有時候會需要更長的時間。It typically takes around 15 minutes for record changes to register, but sometimes it can take longer. 請稍候一段時間,並嘗試挑選變更。Give it some time and a few tries to pick up the change.

在 Microsoft 找到正確的 TXT 記錄後,您的網域就完成驗證了。When Microsoft finds the correct TXT record, your domain is verified.

使用 MX 記錄進行驗證Verify with an MX record

如果您的註冊機構不支援新增 TXT 記錄,您可以新增 MX 記錄以進行驗證。If your registrar doesn't support adding TXT records, you can verify by adding an MX record.

  1. 登入 Microsoft 365 系統管理中心,然後選取 [顯示所有] > [設定] > [網域]Sign in to the Microsoft 365 admin center and select Show all > Settings > Domains.
  2. 在新的瀏覽器索引標籤或視窗中,登入您的 DNS 主機服務提供者,然後尋找您管理 DNS 設定的位置(例如 [區域檔案設定]、[管理網域]、[網域管理員]、[DNS 管理員])。In a new browser tab or window, sign in to your DNS hosting provider, and then find where you manage your DNS settings (e.g., Zone File Settings, Manage Domains, Domain Manager, DNS Manager).
  3. 移至您提供者的 [DNS 管理員] 頁面,並將系統管理中心所指出的 MT 記錄新增到您的網域。Go to your provider's DNS Manager page, and add the MX record indicated in the admin center to your domain.

此 MX 記錄的「優先順序」必須是網域所有現有 MX 記錄的最高者。This MX record's Priority must be the highest of all existing MX records for the domain. 否則,可能會干擾傳送和接收電子郵件。Otherwise, it can interfere with sending and receiving email. 當網域驗證完成後,您應該立即刪除這項記錄。You should delete this records as soon as domain verification is complete.

請確認欄位已設定為下列的值:Make sure that the fields are set to the following values:

  • 記錄類型: MXRecord Type: MX
  • 優先順序: 設定為可用的最高值,通常為 0Priority: Set to the highest value available, typically 0.
  • 主機名稱: @Host Name: @
  • 指向 [位址]: 從系統管理中心複製值並貼上。Points to address: Copy the value from the admin center and paste it here.
  • TTL:3600‎ (或您的提供者預設值)TTL: 3600‎ (or your provider default)

在 Microsoft 找到正確的 MX 記錄後,您的網域即完成驗證。When Microsoft finds the correct MX record, your domain is verified.

步驟2:新增 DNS 記錄以連結 Microsoft 服務Step 2: Add DNS records to connect Microsoft services

在新的瀏覽器索引標籤或視窗中,登入您的 DNS 主機服務提供者,然後尋找您管理 DNS 設定的位置(例如 [區域檔案設定]、[管理網域]、[網域管理員]、[DNS 管理員])。In a new browser tab or window, sign in to your DNS hosting provider, and find where you manage your DNS settings (e.g., Zone File Settings, Manage Domains, Domain Manager, DNS Manager).

視您要啟用的服務而定,您將新增多種不同類型的 DNS 記錄。You'll be adding several different types of DNS records depending on the services you want to enable.

新增電子郵件的 MX 記錄(Outlook、Exchange Online)Add an MX record for email (Outlook, Exchange Online)

開始之前: 如果使用者已經擁有您網域的電子郵件(例如 user@yourdomain.com),請在設定 MX 記錄前,先在系統管理中心建立其帳戶。Before you begin: If users already have email with your domain (such as user@yourdomain.com), create their accounts in the admin center before you set up your MX records. 這樣一來,他們就能繼續收到電子郵件。That way, they’ll continue to receive email. 當您更新網域的 MX 記錄時,使用您網域所有人的所有新電子郵件現在都會傳送至 Microsoft 365。When you update your domain's MX record, all new email for anyone who uses your domain will now come to Microsoft 365. 您已收到的任何電子郵件將會保留在目前的電子郵件主機中,除非您決定將電子郵件和連絡人移轉至 Microsoft 365Any email you already have will stay at your current email host, unless you decide to migrate email and contacts to Microsoft 365.

您將會從系統管理中心網域設定向導取得 MX 記錄的資訊。You'll get the information for the MX record from the admin center domain setup wizard.

在您的主機提供者的網站上,新增 MX 記錄。On your hosting provider's website, add a new MX record. 請確認欄位已設定為下列的值:Make sure that the fields are set to the following values:

  • 記錄類型: MXRecord Type: MX
  • 優先順序: 設定為可用的最高值,通常為 0Priority: Set to the highest value available, typically 0.
  • 主機名稱: @Host Name: @
  • 指向 [位址]: 從系統管理中心複製值並貼上。Points to address: Copy the value from the admin center and paste it here.
  • TTL: 3600‎ (或您的提供者預設值)TTL: 3600‎ (or your provider default)

儲存記錄,然後移除任何其他的 MX 記錄。Save the record, and then remove any other MX records.

新增 CNAME 記錄以連接其他服務 (Teams、Exchange Online、AAD、MDM)Add CNAME records to connect other services (Teams, Exchange Online, AAD, MDM)

您將會從系統管理中心網域設定向導取得 CNAME 記錄的資訊。You'll get the information for the CNAME records from the admin center domain setup wizard.

在您的宿主提供者的網站上,為您要連線的每個服務新增 CNAME 記錄。On your hosting provider's website, add CNAME records for each service that you want to connect. 請確認每個欄位皆已設定為下列的值:Make sure that the fields are set to the following values for each:

  • 記錄類型: CNAME (Alias)Record Type: CNAME (Alias)
  • 主機: 從系統管理中心貼上您複製的值。Host: Paste the values you copy from the admin center here.
  • 指向 [位址]: 從系統管理中心複製值並貼上。Points to address: Copy the value from the admin center and paste it here.
  • TTL: 3600‎ (或您的提供者預設值)TTL: 3600‎ (or your provider default)

新增或編輯 SPF TXT 記錄以協助防範垃圾郵件 (Outlook、Exchange Online)Add or edit an SPF TXT record to help prevent email spam (Outlook, Exchange Online)

在您開始之前: 如果網域已經有 SPF 記錄,請勿為 Microsoft 365 建立一個新的記錄。Before you begin: If you already have an SPF record for your domain, don't create a new one for Microsoft 365. 請改為將所需的 Microsoft 365 值新增到您主機服務提供者網站的目前記錄中,這樣您就有了一份包含兩組值的 單一 SPF 記錄。Instead, add the required Microsoft 365 values to the current record on your hosting providers website so that you have a single SPF record that includes both sets of values.

在您的主機提供者網站上,編輯現有 SPF 記錄或建立 SPF 記錄。On your hosting provider's website, edit the existing SPF record or create an SPF record. 請確認欄位已設定為下列的值:Make sure that the fields are set to the following values:

  • 記錄類型: TXT (Text)Record Type: TXT (Text)
  • 主機: @Host: @
  • TXT 值: v=spf1 include:spf.protection.outlook.com -allTXT Value: v=spf1 include:spf.protection.outlook.com -all
  • TTL: 3600‎ (或您的提供者預設值)TTL: 3600‎ (or your provider default)

儲存記錄。Save the record.

透過其中一個 SPF 驗證工具 以驗證您的 SPF 記錄Validate your SPF record by using one of these SPF validation tools

SPF 是設計來協助防止詐騙,但是仍有 SPF 無法防護的詐騙技術。SPF is designed to help prevent spoofing, but there are spoofing techniques that SPF cannot protect against. 為了防範這些技術,設定 SPF 之後,您也應該為 Microsoft 365 設定 DKIM 和 DMARC。To protect against these, once you've set up SPF, you should also set up DKIM and DMARC for Microsoft 365.

若要開始使用,請參閱在 Microsoft 365 中使用 DKIM 驗證從您的網域傳送的外寄電子郵件使用 DMARC 在 Microsoft 365 中驗證電子郵件To get started, see Use DKIM to validate outbound email sent from your domain in Microsoft 365 and Use DMARC to validate email in Microsoft 365.

新增通訊服務的 SRV 記錄 ( Teams、商務用 Skype)Add SRV records for communications services (Teams, Skype for Business)

在您的主機提供者的網站上,為您要連線的每個服務新增 SRV 記錄。On your hosting provider's website, add SRV records for each service you want to connect. 請確認每個欄位皆已設定為下列的值:Make sure that the fields are set to the following values for each:

  • 記錄類型: SRV (Service)Record Type: SRV (Service)
  • 名稱: @Name: @
  • 目標: 從系統管理中心複製值並貼上。Target: Copy the value from the admin center and paste it here.
  • 通訊協定: 從系統管理中心複製值並貼上。Protocol: Copy the value from the admin center and paste it here.
  • 服務: 從系統管理中心複製值並貼上。Service: Copy the value from the admin center and paste it here.
  • 優先順序: 100Priority: 100
  • 加權: 1Weight: 1
  • 埠:從系統管理中心複製值並貼上。Port: Copy the value from the admin center and paste it here.
  • TTL: 3600‎ (或您的提供者預設值)TTL: 3600‎ (or your provider default)

儲存記錄。Save the record.

SRV 記錄欄位限制和因應措施SRV record field restrictions and workarounds

某些主機提供者會限制 SRV 記錄中的欄位值。Some hosting providers impose restrictions on field values within SRV records. 以下是這些限制的一些常見因應措施。Here are some common workarounds for these restrictions.

姓名Name

如果您的主機服務提供者不允許將此欄位設定為 @,請將它保留為空白。If your hosting provider doesn't allow setting this field to @, leave it blank. 只有 當您的 DNS 主機服務者在服務和通訊協定值有不同的欄位時,才能使用此方法。Use this approach only when your hosting provider has separate fields for the Service and Protocol values. 否則,請參閱下列服務和通訊協定附註。Otherwise, see the Service and Protocol notes below.

服務和通訊協定Service and Protocol

如果您的主機提供者不提供這些用於 SRV 記錄的欄位,您必須在記錄的 [名稱] 欄位中指定 [服務][通訊協定] 值。If your hosting provider doesn't provide these fields for SRV records, you must specify the Service and Protocol values in the record's Name field. (附註:視您的主機提供者而定,[名稱] 欄位可能會是其他名稱,例如:[主機][主機名稱][子網域]) 若要新增這些值,您需建立一個字串,並用點分隔值。(Note: Depending on your hosting provider, the Name field might be called something else, like: Host, Hostname, or Subdomain.) To add these values, you create a single string, separating the values with a dot.

範例:_sip._tlsExample: _sip._tls

優先順序、加權和連接埠Priority, Weight, and Port

如果您的主機服務提供者未提供這些 SRV 記錄欄位,您必須在記錄的 [目標] 欄位中指定它們。If your hosting provider doesn't provide these fields for SRV records, you must specify them in the record's Target field. (注意: 視您的主機提供者而定,[目標] 欄位可能名為其他內容,例如: [內容][IP 位址],或 [目標主機]。)(Note: Depending on your hosting provider, the Target field might be called something else, like: Content, IP Address, or Target Host.)

若要新增這些值,請建立一個字串,並以空格分隔值,有時候會以點 結尾 (如果您不確定,請向您的提供者詢問)。To add these values, create a single string, separating the values with spaces and sometimes ending with a dot (check with your provider if you are unsure). 這些值必須按照以下列順序:Priority、Weight、Port、Target。The values must be included in this order: Priority, Weight, Port, Target.

  • 範例1: 100 1 443 sipdir.online.lync.com.Example 1: 100 1 443 sipdir.online.lync.com.
  • 範例2: 100 1 443 sipdir.online.lync.comExample 2: 100 1 443 sipdir.online.lync.com

運用任何網域註冊機構變更名稱伺服器以設定 Microsoft 365 (文章)Change nameservers to set up Microsoft 365 with any domain registrar (article)</span> 尋找並修正新增網域或 DNS 記錄之後所發生的問題 (文章)Find and fix issues after adding your domain or DNS records (article)</span> 管理網域 (連結頁面)Manage domains (link page)