Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have a test server that is running Ubuntu Server in a windows network.

Networking is configured as follows

auto eth0
iface eth0 inet dhcp
hostname ca

the command cat /etc/hostname returns ca.

But when I use the command host 10.49.156.196 (its current IP address) from another machine on the network, it returns as follows:

196.156.49.10.in-addr.arpa domain name pointer owner-pc.xxxxx.xxx

I can access the machine via SSH and browser using IP address, but not by name ca

Any suggestions? I tried installing samba/nmbd as suggested in another post, but to no avail.

share|improve this question
3  
Please link to the 'another post' you mentioned. –  Oxwivi Feb 25 '11 at 21:01
    
    
Are you setting ca as the hostname in your site/network DNS server? –  belacqua Feb 26 '11 at 5:59
    
i added the line hostname ca to /etc/network/interfaces –  user7242 Feb 26 '11 at 12:50
    
Is the ca hostname also included in /etc/hosts ? –  papukaija Feb 26 '11 at 15:10
show 2 more comments

2 Answers

You have to have the other machines on the network referring to a shared authority, whether it is DNS, synchronized host files, or some other method (e.g., avahi).

The command you are running on the other systems, host, is a DNS utility :

host is a simple utility for performing DNS lookups. It is normally used to convert names to IP addresses and vice versa. When no arguments
or options are given, host prints a short summary of its command line
arguments and options.

As far as the other machines on the network are concerned, it doesn't matter what your machine is referred to locally. You have to have the host/IP registered to a common system.

share|improve this answer
    
So if you request a hostname from the dhcp server in /etc/network/interfaces, is that not enough? –  user7242 Feb 28 '11 at 3:01
    
@user Unless I'm misunderstanding what you're doing, that won't let other machines access your host by name. If you're requesting info from the DHCP server, it will usually give you an IP, subnet and default route. Hostname can also be served to you dynamically or statically, but unless you're using a mechanism you haven't mentioned, the server isn't querying your host or interfaces file for info, it's just responding to a DHCP request. –  belacqua Feb 28 '11 at 3:21
    
I guess I have some reading up to do. Is there a good primer on DNS and DHCP for mixed-OS networks? –  user7242 Feb 28 '11 at 15:31
    
ubuntu serverguide and this DNS How-to are not bad places to start. For cross-OS support, look online for a reference for the technology that's already in place on the other OS. –  belacqua Feb 28 '11 at 21:44
add comment

If you have a small number of other hosts that need to access the server by name, you can simply add a line to each of their /etc/hosts files:

10.49.156.196 ca 

This is really just setting up an alias on each of those machines, but it's far quicker than learning to manage a DNS server and will work on OSX or windows clients as well (\windows\system32\drivers\etc\hosts).

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.