# SSH Domain Resolve Error ドメイン名解決エラーについて

**URL:** https://forum.ficusonline.com/t/ssh-domain-resolve-error/151
**Category:** Server
**Created:** [2018 年 1 月 14 日午前 8:44 UTC](https://forum.ficusonline.com/t/ssh-domain-resolve-error/151 "2018-01-14T08:44:46Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![tk-fuse](https://forum.ficusonline.com/user_avatar/forum.ficusonline.com/tk-fuse/32/255_2.png) [@tk-fuse](https://forum.ficusonline.com/u/tk-fuse)
#### Post date: [2018 年 1 月 14 日午前 8:44 UTC](https://forum.ficusonline.com/t/ssh-domain-resolve-error/151/1 "2018-01-14T08:44:46Z")

</div>

SSH接続時におけるロカールネットワーク内サーバのドメイン名解決エラーについて。

**参照サイト**

> **[Fix: SSH Error 'could not resolve hostname server'](https://appuals.com/fix-ssh-error-not-resolve-hostname-server/)**
>
> You'll sometimes see an error telling you that ssh couldn't resolve a hostname when you attempt to use it. If you're getting this error, then you should

ポイントは **/etc/hosts** と **/etc/hostname** の中身です。  
ネットワーク内にある端末のホストネームは **/etc/hostname** で定義されています。  
ターミナルを起動すると

> username@your\_hostname:~$

と表示されます。ホストネームを変更する場合は **/etc/hostname** の中身を書換えます。

次に **/etc/hosts** の中身を下記のようにします。

> $sudo pico /etc/hosts

```
127.0.0.1 localhost
127.0.1.1 your_hostname
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

```

avahi-daemonにより（ubuntuではデフォルトのサービス）同一ネットワーク内の他の端末から  
**your\_hostname.local**  
を指定することでアクセスできるようになります。
