web-dev-qa-db-ja.com

名前ではローカルホストにアクセスできませんが、IPアドレスではアクセスできます

私はUbuntuが初めてで、ネットワーキングの初心者です。新しくインストールした13.10(GUIなし)サーバーからローカルネットワーク上のホストに名前でアクセスできません。 DHCPサーバーとして構成されていません。 DHCPサーバーにNetgear R6300v2を使用しています。

SSHセッションからWinpro7(192.163.1.3)から名前(unix3)でサーバーにSSH接続できます:Google.comにpingできますWinPro7にpingできません192.168.1.3(WinPro7)にpingできますdhclientはifconfig looksを実行しています良い ?

ここにすべての関連情報を取得しようとしたSSHセッションからのログがあります

    =~=~=~=~=~=~=~=~=~=~=~= PuTTY log 2014.02.01 09:49:39 =~=~=~=~=~=~=~=~=~=~=~=
Using username "frank".
frank@unix3's password:
Welcome to Ubuntu 13.10 (GNU/Linux 3.11.0-15-generic i686)

 * Documentation:  https://help.ubuntu.com/

  System information as of Sat Feb  1 09:51:41 EST 2014

  System load:  0.04               Processes:           95
  Usage of /:   1.4% of 120.70GB   Users logged in:     1
  Memory usage: 2%                 IP address for eth0: 192.168.1.22
  Swap usage:   0%

  Graph this data and manage this system at:
    https://landscape.canonical.com/

Last login: Sat Feb  1 09:51:41 2014 from 192.168.1.3

frank@unix3:~$ ping google.com -c3
PING google.com (74.125.226.227) 56(84) bytes of data.
64 bytes from lga15s29-in-f3.1e100.net (74.125.226.227): icmp_seq=1 ttl=53 time=50.0 ms
64 bytes from lga15s29-in-f3.1e100.net (74.125.226.227): icmp_seq=2 ttl=53 time=36.5 ms
64 bytes from lga15s29-in-f3.1e100.net (74.125.226.227): icmp_seq=3 ttl=53 time=36.0 ms

--- google.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2009ms
rtt min/avg/max/mdev = 36.022/40.863/50.033/6.489 ms

frank@unix3:~$ ping WinPro7 -c3
ping: unknown Host WinPro7

frank@unix3:~$ ping 192.168.1.3 -c3
PING 192.168.1.3 (192.168.1.3) 56(84) bytes of data.
64 bytes from 192.168.1.3: icmp_seq=1 ttl=128 time=0.918 ms
64 bytes from 192.168.1.3: icmp_seq=2 ttl=128 time=0.467 ms
64 bytes from 192.168.1.3: icmp_seq=3 ttl=128 time=0.422 ms

--- 192.168.1.3 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2007ms
rtt min/avg/max/mdev = 0.422/0.602/0.918/0.224 ms

frank@unix3:~$ ifconfig /-a
eth0      Link encap:Ethernet  HWaddr 00:15:5d:01:04:3d  
          inet addr:192.168.1.22  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::215:5dff:fe01:43d/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:4883 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1848 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:802381 (802.3 KB)  TX bytes:169483 (169.4 KB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:24 errors:0 dropped:0 overruns:0 frame:0
          TX packets:24 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:1664 (1.6 KB)  TX bytes:1664 (1.6 KB)


frank@unix3:~$ cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 192.168.1.1

frank@unix3:~$ ps -ef | grep dhclient
root       762     1  0 09:26 ?        00:00:00 dhclient -1 -v -pf /run/dhclient.eth0.pid -lf /var/lib/dhcp/dhclient.eth0.leases eth0
frank     1581  1445  0 09:49 pts/0    00:00:00 grep --color=auto dhclient

frank@unix3:~$ cat  /var/lib/dhcp/dhclient.eth0.leases
lease {
  interface "eth0";
  fixed-address 192.168.1.22;
  option subnet-mask 255.255.255.0;
  option routers 192.168.1.1;
  option dhcp-lease-time 86400;
  option dhcp-message-type 5;
  option domain-name-servers 192.168.1.1;
  option dhcp-server-identifier 192.168.1.1;
  renew 5 2014/01/31 22:14:27;
  rebind 5 2014/01/31 22:14:27;
  expire 5 2014/01/31 22:14:27;
}
lease {
  interface "eth0";
  fixed-address 192.168.1.22;
  option subnet-mask 255.255.255.0;
  option routers 192.168.1.1;
  option dhcp-lease-time 86400;
  option dhcp-message-type 5;
  option domain-name-servers 192.168.1.1;
  option dhcp-server-identifier 192.168.1.1;
  renew 0 2014/02/02 01:43:44;
  rebind 0 2014/02/02 11:26:27;
  expire 0 2014/02/02 14:26:27;
}

frank@unix3:~$ hostname
unix3

frank@unix3:~$ Sudo ufw status
Status: inactive

frank@unix3:~$ Sudo netstat -uap
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
udp        0      0 *:bootpc                *:*                                 762/dhclient    
udp        0      0 192.168.1.25:netbios-ns *:*                                 833/nmbd        
udp        0      0 192.168.1.22:netbios-ns *:*                                 833/nmbd        
udp        0      0 *:netbios-ns            *:*                                 833/nmbd        
udp        0      0 192.168.1.2:netbios-dgm *:*                                 833/nmbd        
udp        0      0 192.168.1.2:netbios-dgm *:*                                 833/nmbd        
udp        0      0 *:netbios-dgm           *:*                                 833/nmbd        
udp        0      0 *:28567                 *:*                                 762/dhclient    
udp6       0      0 [::]:32733              [::]:*                              762/dhclient

frank@unix3:~$ exit
logout

助けていただければ幸いです

2
NotTheOne
  1. Winbindをインストールする

    Sudo apt-get install winbind
    
  2. ホスト解決構成にWINSを追加

    Sudo nano /etc/nsswitch.conf
    

    winsをhosts行に追加します。例:

    hosts:     files wins dns myhostname mdns4_minimal [NOTFOUND=return] mdns4
    

HOWTO:ホスト名を正しく解決する を参照してください


他にAvahiを使用する

  1. UbuntuマシンにAvahi DNS設定ツールをインストールします

    Sudo apt-get install avahi-dnsconfd
    
  2. WindowsマシンにインストールApple Bonjour

    http://support.Apple.com/downloads/DL999/en_US/BonjourPSSetup.exe

ping WinPro7.local

Avahi(Wikipedia) または その公式Webサイト を参照してください。

1
user.dz

ターミナルを開く:

Sudo -H gedit /etc/hosts

追加 192.168.1.3 WinPro7

あなたのコンピュータはこれがこのホスト名のIPであることを知っているでしょう

0
nux