ドメインエイリアスとは何ですか?
ドメインエイリアスは、プライマリドメインと同じウェブサイト、アプリケーション、コンテンツにポイントする二次ドメイン名です。 正しく構成されると、複数のドメイン名は同一のコンテンツを提供でき、異なる方法で同じ宛先に到達することができます。
ドメインエイリアス対ドメインフォワード
| 特徴: | ドメインエイリアス | ドメインリダイレクト/フォワード |
|---|---|---|
| ブラウザのURL | エイリアスドメインを表示する | プライマリドメインを表示する |
| コンテンツ提供 | 同じサイトから | リダイレクト機能 |
| HTTPステータス | 200 OK | 301/302 リダイレクト |
| SEOの影響 | コンテンツリスクの重複 | プライマリへの統合 |
| DNS設定 | A/AAAAAAまたは名前 | 通常 A/AAAAA + リダイレクト |
| 電子メール | メールでのお問い合わせ | 個別のメール設定 |
User types: shop.example.com
Browser shows: shop.example.com
Content from: example.com (same server, same content)
ドメインリダイレクト(URL変更):
User types: shop.example.com
Browser redirects to: example.com
Browser shows: example.com
ドメイン エイリアスの設定
DNS設定
どちらのドメインも同じサーバーを指しています。
# Primary domain
example.com. IN A 203.0.113.50
# Alias domain
example.net. IN A 203.0.113.50
shop-example.com. IN A 203.0.113.50
別名でCNAMEを使うか:
shop.example.com. IN CNAME example.com.
ウェブサーバの設定
####Apache
<VirtualHost *:80>
ServerName example.com
ServerAlias example.net shop.example.com www.example.net
DocumentRoot /var/www/example
<Directory /var/www/example>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
###########################################################################################Nginx##########################################Nginx#####################################################################################################################
server {
listen 80;
server_name example.com example.net shop.example.com;
root /var/www/example;
index index.html index.php;
location / {
try_files $uri $uri/ =404;
}
}
#### Cloudflare (CNAME セットアップ)
1. Add alias domain to Cloudflare
2. Create CNAME record:
shop.example.com → example.com
3. Enable "Flatten all CNAMEs" in DNS settings
4. Enable "Always Use HTTPS"
cPanel/WHMの特長
Addon Domain (新しいサイトを作成します):Domains → Addon Domains → Create New Domain
Alias/Parked Domain (既存のサイトへのポイント):
Domains → Aliases → Create a New Alias
Enter domain: shop.example.com
Alias for: example.com
一般的なユースケース
ブランドバリエーション
サイバースクワッティングを防ぐための一般的なバリエーションを登録します。
example.com (primary)
example.net (alias)
example.org (alias)
example.io (alias)
##タイポ保護
一般的なスペルミスをキャプチャ:
example.com (primary)
exampel.com (alias - typo)
exmple.com (alias - typo)
地域ドメイン
国固有の TLD で同じコンテンツを配信:
example.com (primary, global)
example.co.uk (alias, UK)
example.de (alias, Germany)
example.fr (alias, France)
注意: 真の国際化のために、代わりにhreflangタグとローカライズされたコンテンツを使用します。
##マーケティングキャンペーン
短い、思い出に残るキャンペーンドメイン:
example.com (primary site)
summerosale2024.com (alias for campaign landing page)
##サブドメイン エイリアス
shop.example.com (alias)
store.example.com (alias)
→ Both serve same e-commerce site
##製品またはサービスブランディング
companyname.com (primary)
productname.com (alias)
ドメインエイリアスのためのSEOの検討
重複コンテンツの問題
検索エンジンは、ドメインエイリアスを重複コンテンツとして表示することができます。
example.com/about
example.net/about
→ Same content, different URLs = duplicate
条件: 分割権限, 低いランキング.
##キャニカルタグ
ドメインがプライマリである検索エンジンに教えてください。
<!-- On all pages, regardless of domain -->
<link rel="canonical" href="https://example.com/page-path" />
これは、検索エンジンに「このURLとしてすべてのバージョンを扱います」と言います。
推奨ソリューション:301 リダイレクト
エイリアスではなく、プライマリドメインにリダイレクトします。
Apache (.htaccess):RewriteEngine On
RewriteCond %{HTTP_HOST} !^example\.com$ [NC]
RewriteRule ^(.*)$ https://example.com/$1 [R=301,L]
Nginx:
server {
listen 80;
server_name example.net shop.example.com;
return 301 https://example.com$request_uri;
}
これは、プライマリドメインにすべてのSEO権限を統合します。
エイリアスが受け入れられるとき
- 内部/開発ドメイン(インデックスなし)
noindexタグ付きドメイン- メール専用ドメイン(Webコンテンツなし)
- 正式なキャンペーンドメインと正式なタグ
ドメイン エイリアス用のメール設定
共有メール(メールボックス)
すべてのドメインのMXレコードの設定:
example.com. IN MX 10 mail.example.com.
example.net. IN MX 10 mail.example.com.
john@example.com and john@example.net → same mailbox
別々のメール(特定のメールボックス)
各ドメインは独立した電子メールを持っています。
example.com. IN MX 10 mail.example.com.
example.net. IN MX 10 mail.example.net.
john@example.com ≠ john@example.net (different mailboxes)
###Eメールキャッチ-すべてのアクロスアリアーズ
任意のエイリアスドメインの任意のアドレスに電子メールを受け入れる:
# Postfix virtual
@example.com catchall@example.com
@example.net catchall@example.com
@shop.example.com catchall@example.com
SSL/TLS ライセンス認証
##マルチドメイン(SAN)証明書
すべてのエイリアスをカバーする1つの証明書:
Certificate SANs:
example.com
www.example.com
example.net
www.example.net
shop.example.com
暗号化しましょう:
certbot certonly --nginx \
-d example.com -d www.example.com \
-d example.net -d www.example.net \
-d shop.example.com
##ワイルドカード証明書
プライマリドメインのすべてのサブドメインをカバーします。
*.example.com
→ Covers shop.example.com, blog.example.com, etc.
→ Does NOT cover example.net or other TLDs
###別々の証明書
ドメインごとの個々の証明書:
example.com → cert1
example.net → cert2
ベストプラクティス
常にすべてのエイリアスで HTTPS を使用する
すべてのドメインが有効なSSLを持っている必要があります。
✓ https://example.com
✓ https://example.net
✓ https://shop.example.com
###Canonicalタグの実装
同じコンテンツを配信しても、canonical タグを使う:
<link rel="canonical" href="https://example.com/current-page" />
301は、アリアーゼにリダイレクトする
SEOの場合、エイリアスをプライマリにリダイレクトします。
example.net → 301 redirect → example.com
shop.example.com → 301 redirect → example.com/shop
モニター すべてのドメイン
稼働時間監視ですべてのエイリアスを含める:
- Monitor DNS resolution for all aliases
- Check SSL certificate validity
- Verify web server responds correctly
一貫したブランディング
エイリアスを使用する場合は、一貫性のあるブランディングを保証します。
Same logo, colors, navigation across all domains
Or clearly indicate relationship
##ドキュメントエイリアス戦略
ドキュメントを維持する:
# domains.md
Domain Type Purpose Points To example.com Primary Main site Server A example.net Alias Brand protection Server A shop.example.com Alias E-commerce Server A
ドメイン消去のテスト
##DNSの決議を確認する
# Check all aliases resolve to same IP
dig example.com A +short
dig example.net A +short
dig shop.example.com A +short
# Should all return same IP or equivalent CNAME chain
##テストWebサーバーの設定
# Verify server responds to all domains
curl -I https://example.com
curl -I https://example.net
curl -I https://shop.example.com
# Should all return 200 OK (or 301 if redirecting)
チェック SSL 証明書
# Verify SSL covers all domains
echo | openssl s_client -servername example.net -connect example.com:443 2>/dev/null | openssl x509 -noout -text | grep DNS
# Should list all alias domains in SANs
SEO 検証
# Check canonical tags
curl -s https://example.net/page | grep "canonical"
# Should point to primary domain
<link rel="canonical" href="https://example.com/page" />
セキュリティの考慮事項
##ドメインハイジャックリスク
より多くのドメイン = より多くの攻撃面:
- 不正な変更のためのすべてのドメインを監視
- 重要なエイリアスにレジストリロックを使用する
- レジストラで2FAを有効にする
フィッシング保護
防御的なエイリアスを登録してフィッシングを防ぐ:
example.com (primary)
examp1e.com (homoglyph protection)
example-secure.com (defensive)
一貫したセキュリティポリシー
すべてのエイリアスに同じセキュリティを適用します。
-同じHSTSヘッダー
- 同じCSPポリシー
- 同じ認証要件
ドメインエイリアスは、ブランド保護とユーザーの利便性に役立ちますが、SEOの罰則やセキュリティリスクを避けるために、慎重に設定する必要があります。