# Computer can only be reached by ip address, not computer nam

## billydv

I have a cups server that just stopped working, couldn't figure out the problem but it seems that now I have, I can reach it by ip address 192.168.1.4, but I cant reach it by name Windows2. This is the same for  ssh, can login with 192,168.1.4 but cant login by Windows name, Whats going on?

----------

## poly_poly-man

DNS problem. What computer on your network is running a DNS server?

poly-p man

----------

## billydv

I  actually  know  very  little  about  dns  servers,  I  have  a  small  network  of  6  or  7  computers  in  the  house,  all  in  the  same  workgroup, (my childrens  computers,  my  various  computers).  There  is  file  sharing  between  them  by  use  of  samba  but  I  couldn't tell  you  any  more  than  that.

----------

## jcat

Name to address resolution can be achieved via a number of mechanisms, for example "hosts file" (locally), or DNS server, or NETBIOS (in the windows world, but being phased out).

You need to find out out what was providing name resolution previously in order to fix it.  If you didn't set up (and hence don't have) a DNS server, you probably either have a hosts file with the relevant entries, or are using NETBIOS maybe or something (that would use a package from the Samba suite, winbind).

If you can't work out how it used to work, just create entries in your host file or set-up DNS for your network.

What OS are your windows machines, are any of them servers? (they might have DNS with DHCP auto-configured)

Cheers,

jcat

----------

## billydv

The  os's  are  as  follows,  1  Win  XP  professional,  1  Debian  Amd64,  1  Gentoo  amd64,  1  Gentoo  X86 (  this  computer  can  be  reached  by  its  name  to  install  a  printer  attached  to  cups  but  for  the  life  of  me  I  cant  find  the  difference  in  settings!!!),  1  Mandriva  x86,  1  Ubuntu  x86,  1  Suse  x86.  

The  machine  that  I  typically  use  for  cups  server  is  the  Gentoo  amd64.

here  is  the  hosts  file

# /etc/hosts: Local Host Database

#

# This file describes a number of aliases-to-address mappings for the for 

# local hosts that share this file.

#

# In the presence of the domain name service or NIS, this file may not be 

# consulted at all; see /etc/host.conf for the resolution order.

#

# IPv4 and IPv6 localhost aliases

#127.0.0.1	localhost

127.0.0.1	Windows2.MSHOME Windows2 localhost

::1	localhost

#

# Imaginary network.

#10.0.0.2               myname

#10.0.0.3               myfriend

#

# According to RFC 1918, you can use the following IP networks for private 

# nets which will never be connected to the Internet:

#

#       10.0.0.0        -   10.255.255.255

#       172.16.0.0      -   172.31.255.255

#       192.168.0.0     -   192.168.255.255

#

# In case you want to be able to connect directly to the Internet (i.e. not 

# behind a NAT, ADSL router, etc...), you need real official assigned 

# numbers.  Do not try to invent your own network numbers but instead get one 

# from your network provider (if any) or from your regional registry (ARIN, 

# APNIC, LACNIC, RIPE NCC, or AfriNIC.)

#

host.conf

# /etc/host.conf:

# $Header: /var/cvsroot/gentoo/src/patchsets/glibc/extra/etc/host.conf,v 1.1 2006/09/29 23:52:23 vapier Exp $

# The  file /etc/host.conf contains configuration information specific to

# the resolver library.  It should contain one configuration keyword  per

# line,  followed by appropriate configuration information.  The keywords

# recognized are order, trim, mdns, multi, nospoof, spoof, and reorder.

# This keyword specifies how host lookups are to be performed. It

# should be followed by one or more lookup methods, separated by

# commas.  Valid methods are bind, hosts, and nis.

#

order hosts, bind

# Valid  values are on and off.  If set to on, the resolv+ library

# will return all valid addresses for a host that appears  in  the

# /etc/hosts  file,  instead  of  only  the first.  This is off by

# default, as it may cause a substantial performance loss at sites

# with large hosts files.

#

multi off

here  is  /etc/conf.d/hostname  (computer  is  still  named  for  its  previous  os)  :Rolling Eyes: 

# Set to the hostname of this machine

hostname="Windows2"

And  now  I  emerged  bind  and  have  left  the  default  config  files  in  all  places  and  just  added  it  to  default  runlevel

----------

## billydv

Another  strange  thing  is  that  when  I  open  the  kde  control  center  to  add  a  printer,  If  I  am  on  the  machine  that  is  running  the  cups  server,  I  can  do  add  printer  from  remote  cups  server  and  with  just  the  computer  name  it  will  find  the  printers  available  on  that  same  computer,  when  I  go  to  a  different  computer,  It  will  say  that  its  unreachable  but  if  I  put  in  the  ip  address,  it  finds  the  computer  perfectly.

----------

## jcat

If you want a quick and easy solution you need to set-up /etc/hosts on all the "client" hosts that want to be able to use the name instead of IP.  So ad an entry like the following to the /etc/hosts file on all the other hosts (substitute the correct IP address of course):

```
192.168.0.100    Windows2
```

That allows all the "client" computers to use "Windows2" instead of 192.168.0.100 to address that computer.  This is basic networking stuff, I think you'll find some info on it in the Gentoo handbook.  Worth a read  :Smile: 

However, if you want to use DNS instead you need to select which host is going to run the service, then configure the server side and all the other hosts to use the server fro DNS.

http://gentoo-wiki.com/HOWTO_Setup_a_DNS_Server_with_BIND

Cheers,

jcat

----------

