Operating System - Linux
1827808 Members
2727 Online
109969 Solutions
New Discussion

DNS server : named configuration

 
Elio Giusto
Occasional Advisor

DNS server : named configuration

Hi,

I've installed a local network (C class).
But I don't know how to configure in Linux PC-based a local hostname resolver.

By telnet and ftp command, I've not any problem ... but when I try "host" command I receive the following message:

"unresolved hostname"
6 REPLIES 6
Alexander Chuzhoy
Honored Contributor

Re: DNS server : named configuration

For local hostname resolving you can put the info in to the file /etc/hosts.
for instance the command:
echo 10.0.0.1 pcname >> /etc/hosts

willallow you to access pcname by it's hostname.
You can always configure DNS ,but it requires some documents reading first.
Elio Giusto
Occasional Advisor

Re: DNS server : named configuration

That's all right.

But the problem is not resolved.

#### /etc/hosts example -----------------
192.168.100.4 remotehost
192.168.100.15 localhost
#### ------------------------------------


Which is the error ?!
Steven E. Protter
Exalted Contributor

Re: DNS server : named configuration

Just hazarding a guess, but perhaps there is a data mismatch in the /etc/hosts to the actual machine ip address.

Make sure the primary ip address matches.

Also, for /etc/hosts name resolution to work the host resolution line in /etc/nsswtich.conf must include files. It can just be dns.

Check that and you should be able to resolve this.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Vitaly Karasik_1
Honored Contributor

Re: DNS server : named configuration

>192.168.100.4 remotehost
>192.168.100.15 localhost

so your situation is :
from localhost to remotehost your can ping/telnet/ftp by IP but not by name?

Which error message do you see when "ping remotehost"?
Elio Giusto
Occasional Advisor

Re: DNS server : named configuration

I can ping/telnet/ftp by name too, but when I try to resolve the client host names with "host" command, I've any problem:

"connection timeout,, host unreachable"

Regards
Vitaly Karasik_1
Honored Contributor

Re: DNS server : named configuration

it's OK,

AFAIK

"host", "dig" works with DNS only and don't know to use /etc/hosts and NIS.

So you situation is OK.

Now you have two ways to support your boxes with up-to-date hosts table - to distribute /etc/hosts from "master" server using rsync/rcp/scp/... or using NIS.