Help us understand the problem. What is going on with this article?

日本語ドメインをDNSに設定する

More than 3 years have passed since last update.

日本語ドメインをDNSに設定する方法

日本語ドメインそのままDNSに設定するとエラーが発生する。
punycodeに変換して使用する必要がある。

idnコマンドを利用する

idnコマンドを使用してpunycodeに変換する。

下記でidnコマンドをインストール
yum install libidn

コマンド
# idn 日本語
libidn 1.18
Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Simon Josefsson.
GNU Libidn comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of GNU Libidn under the terms of
the GNU Lesser General Public License.  For more information
about these matters, see the file named COPYING.LIB.
xn--wgv71a119e

上記のように日本語は「xn--wgv71a119e」と変換される

zoneファイルへの記述

bindのゾーンファイルへは変換後の文字列で記載します。

zoneファイル
zone "test.xyz" {type master; allow-query { any; }; file "test.xyz.db";};
zone "xn--wgv71a119e.xyz" {type master; allow-query { any; }; file "common.zone.db";};

確認方法

digコマンドはそのまま日本語が使用できます。
変換後の文字列でもOKです。
下記どちらでも同じ結果になります。

# dig 日本語.xyz @localhost
# dig xn--wgv71a119e.xyz @localhost

以上

kite_999
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした