Networking Forums

Networking Forums > Computer Networking > Linux Networking > Can I use hostnames with only DHCP, no DNS?

Reply
Thread Tools Display Modes

Can I use hostnames with only DHCP, no DNS?

 
 
Brian Kendig
Guest
Posts: n/a

 
      11-19-2007, 08:23 PM
If I've got a home network that's assigning addresses via DHCP, and it
doesn't have any local DNS server on it, and every computer on the
network has a hostname - can I connect from one computer to another by
name?

That is, if one computer is named 'foo' and the other is named 'bar',
when I log on to 'foo' and type 'ssh bar', will that work?

Or does DHCP not pay any attention to local hostnames, and I'll need
to set up the computer names in a DNS server on my network?

 
Reply With Quote
 
 
 
 
Ashish Shukla आशीष शुक्ल
Guest
Posts: n/a

 
      11-19-2007, 08:50 PM
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Brian Kendig wrote:
> If I've got a home network that's assigning addresses via DHCP, and it
> doesn't have any local DNS server on it, and every computer on the
> network has a hostname - can I connect from one computer to another by
> name?


no, unless you're you going to setup some another nameserver like WINS. Or
how about using mDNS[1] using Avahi[2].

> That is, if one computer is named 'foo' and the other is named 'bar',
> when I log on to 'foo' and type 'ssh bar', will that work?
>
> Or does DHCP not pay any attention to local hostnames, and I'll need
> to set up the computer names in a DNS server on my network?


Couple of DHCP servers support this feature known as DDNS which will update
dynamically update DNS server. To use this, client needs to send its
hostname, which DHCP server will add to the DNS server's zone. ISC 'dhcpd'
and 'bind' supports this. Also check out 'dnsmasq', but not sure if it
supports 'ddns'.

References:
[1] - http://en.wikipedia.org/wiki/Zeroconf
[2] - http://www.avahi.org/

HTH
- --
Ashish Shukla आशीष शुक्ल http://wahjava.wordpress.com/
·-- ·- ···· ·--- ·- ···- ·- ·--·-· --· -- ·- ·· ·-·· ·-·-·- -·-· --- --
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFHQgU8Hy+EEHYuXnQRAshmAJ9aRPuZsLhyZPmnQ3HXf3 Z7+tvW1wCaAzGl
eGSMe5ZGsqqhIfg/7z3fbwU=
=6Fup
-----END PGP SIGNATURE-----
 
Reply With Quote
 
Allen Kistler
Guest
Posts: n/a

 
      11-19-2007, 10:02 PM
Brian Kendig wrote:
> If I've got a home network that's assigning addresses via DHCP, and it
> doesn't have any local DNS server on it, and every computer on the
> network has a hostname - can I connect from one computer to another by
> name?
>
> That is, if one computer is named 'foo' and the other is named 'bar',
> when I log on to 'foo' and type 'ssh bar', will that work?
>
> Or does DHCP not pay any attention to local hostnames, and I'll need
> to set up the computer names in a DNS server on my network?


DHCP does not do name resolution. It only hands out addresses.

If you set up DHCP reservations, so that known hosts always get the same
IP addresses, then you can put /etc/hosts files on all your hosts to do
name resolution.

For small numbers of hosts, /etc/hosts is quite workable. Once upon a
time, the world was small and all name resolution used /etc/hosts. Then
the world got bigger and DNS was invented to solve the problem that
managing big /etc/hosts files quickly becomes very hard. But if your
world is still small, /etc/hosts still works fine.
 
Reply With Quote
 
Tauno Voipio
Guest
Posts: n/a

 
      11-21-2007, 07:33 PM
Brian Kendig wrote:
> If I've got a home network that's assigning addresses via DHCP, and it
> doesn't have any local DNS server on it, and every computer on the
> network has a hostname - can I connect from one computer to another by
> name?
>
> That is, if one computer is named 'foo' and the other is named 'bar',
> when I log on to 'foo' and type 'ssh bar', will that work?
>
> Or does DHCP not pay any attention to local hostnames, and I'll need
> to set up the computer names in a DNS server on my network?



There is a small DNS forwarding daemon for
small networks with DHCP clients: dnsmasq.

It also can serve names from the /etc/hosts
file of the server.

--

Tauno Voipio
tauno voipio (at) iki fi
 
Reply With Quote
 
Stefan Monnier
Guest
Posts: n/a

 
      11-23-2007, 03:11 PM
> Couple of DHCP servers support this feature known as DDNS which will update
> dynamically update DNS server. To use this, client needs to send its
> hostname, which DHCP server will add to the DNS server's zone. ISC 'dhcpd'
> and 'bind' supports this. Also check out 'dnsmasq', but not sure if it
> supports 'ddns'.


dnsmasq "does it", although it's not clear what is precisely meant by
"it". At least it does allow you to access local machines using the
machine's names (provided to dnsmasq via the DHCP handshake).


Stefan
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: hostnames Meinolf Weber [MVP-DS] Windows Networking 1 03-15-2010 05:25 AM
Re: hostnames Meinolf Weber [MVP-DS] Windows Networking 0 03-14-2010 06:51 PM
Using hostnames in iptables David Brown Linux Networking 4 03-18-2008 03:59 PM
Use dhclient with two hostnames zushi Linux Networking 1 06-07-2005 01:20 PM
Can dhcp generate hostnames? Ray Linux Networking 3 09-23-2003 01:44 PM



1 2 3 4 5 6 7 8 9 10 11