Can I use hostnames with only DHCP, no DNS? - Networking

This is a discussion on Can I use hostnames with only DHCP, no DNS? - Networking ; 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 ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: Can I use hostnames with only DHCP, no DNS?

  1. Can I use hostnames with only DHCP, no DNS?

    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?


  2. Re: Can I use hostnames with only DHCP, no DNS?

    -----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-----

  3. Re: Can I use hostnames with only DHCP, no DNS?

    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.

  4. Re: Can I use hostnames with only DHCP, no DNS?

    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 to Thread