Can I use hostnames with only DHCP, no DNS?

Discussion in 'Linux Networking' started by Brian Kendig, Nov 19, 2007.

  1. Brian Kendig

    Brian Kendig Guest

    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?
     
    Brian Kendig, Nov 19, 2007
    #1
    1. Advertisements

  2. -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    no, unless you're you going to setup some another nameserver like WINS. Or
    how about using mDNS[1] using Avahi[2].
    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+EEHYuXnQRAshmAJ9aRPuZsLhyZPmnQ3HXf3Z7+tvW1wCaAzGl
    eGSMe5ZGsqqhIfg/7z3fbwU=
    =6Fup
    -----END PGP SIGNATURE-----
     
    Ashish Shukla आशीष शà¥à¤•à¥à¤², Nov 19, 2007
    #2
    1. Advertisements

  3. 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.
     
    Allen Kistler, Nov 19, 2007
    #3
  4. Brian Kendig

    Tauno Voipio Guest


    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, Nov 21, 2007
    #4
  5. Couple of DHCP servers support this feature known as DDNS which will update
    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
     
    Stefan Monnier, Nov 23, 2007
    #5
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.