0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

今更CentOS6でmDNSを有効にする戦いをする

Posted at

はじめに

の二番煎じ。

Step

nss-mdnsパッケージのインストール

$ sudo yum install https://archives.fedoraproject.org/pub/archive/epel/6/x86_64/Packages/n/nss-mdns-0.10-8.el6.x86_64.rpm
読み込んだプラグイン:fastestmirror, refresh-packagekit, security
インストール処理の設定をしています
nss-mdns-0.10-8.el6.x86_64.rpm                                                                                                                                                                                         |  22 kB     00:00
/var/tmp/yum-root-YpvMqW/nss-mdns-0.10-8.el6.x86_64.rpm を調べています: nss-mdns-0.10-8.el6.x86_64
/var/tmp/yum-root-YpvMqW/nss-mdns-0.10-8.el6.x86_64.rpm をインストール済みとして設定しています
Loading mirror speeds from cached hostfile
依存性の解決をしています
--> トランザクションの確認を実行しています。
---> Package nss-mdns.x86_64 0:0.10-8.el6 will be インストール
--> 依存性の処理をしています: avahi のパッケージ: nss-mdns-0.10-8.el6.x86_64
--> トランザクションの確認を実行しています。
---> Package avahi.x86_64 0:0.6.25-17.el6 will be インストール
--> 依存性解決を終了しました。

依存性を解決しました

==============================================================================================================================================================================================================================================
 パッケージ                                          アーキテクチャ                                    バージョン                                                リポジトリー                                                            容量
==============================================================================================================================================================================================================================================
インストールしています:
 nss-mdns                                            x86_64                                            0.10-8.el6                                                /nss-mdns-0.10-8.el6.x86_64                                             71 k
依存性関連でのインストールをします。:
 avahi                                               x86_64                                            0.6.25-17.el6                                             base                                                                   219 k

トランザクションの要約
==============================================================================================================================================================================================================================================
インストール         2 パッケージ

合計容量: 290 k
総ダウンロード容量: 219 k
インストール済み容量: 852 k
これでいいですか? [y/N]y
パッケージをダウンロードしています:
avahi-0.6.25-17.el6.x86_64.rpm                                                                                                                                                                                         | 219 kB     00:00
rpm_check_debug を実行しています
トランザクションのテストを実行しています
トランザクションのテストを成功しました
トランザクションを実行しています
  インストールしています  : avahi-0.6.25-17.el6.x86_64                                                                                                                                                                                    1/2
  インストールしています  : nss-mdns-0.10-8.el6.x86_64                                                                                                                                                                                    2/2
  Verifying               : avahi-0.6.25-17.el6.x86_64                                                                                                                                                                                    1/2
  Verifying               : nss-mdns-0.10-8.el6.x86_64                                                                                                                                                                                    2/2

インストール:
  nss-mdns.x86_64 0:0.10-8.el6

依存性関連をインストールしました:
  avahi.x86_64 0:0.6.25-17.el6

完了しました!

$  grep ^host /etc/nsswitch.conf
hosts:      files mdns4_minimal [NOTFOUND=return] dns
$ sudo /etc/init.d/avahi-daemon start
Avahi デーモンを起動中...                                  [  OK  ]
$ sudo /etc/init.d/avahi-daemon status
avahi-daemon (pid  3436) を実行中...
$ ps auxwww|grep local |grep ^avahi
avahi     3436  0.0  0.0  27660  1640 ?        S    17:12   0:00 avahi-daemon: running [yumetodo-vm-centos6-rvm.local]

eth0の自動接続

iptables

$ sudo system-config-firewall-tui

基本的には↑の通り行うが、"その他のポート"という画面で5353:udpを開放する。自分はついでに3000:tcpも開放した。

$ sudo iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination
ACCEPT     all  --  anywhere             anywhere            state RELATED,ESTABLISHED
ACCEPT     icmp --  anywhere             anywhere
ACCEPT     all  --  anywhere             anywhere
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:ssh
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:hbci
ACCEPT     udp  --  anywhere             anywhere            state NEW udp dpt:mdns
REJECT     all  --  anywhere             anywhere            reject-with icmp-host-prohibited

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination
REJECT     all  --  anywhere             anywhere            reject-with icmp-host-prohibited

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

再起動

$ sudo reboot

ここまで来るとping <hostname>で見つかるようになる。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?