Results 1 to 3 of 3

Thread: cannot resolve Unknown host (when I add the domain to the hostname)

  1. #1
    Join Date
    May 2013

    Unhappy cannot resolve Unknown host (when I add the domain to the hostname)

    I'm under the assumption that my Ubuntu 20.04 internal server without a FQDN would have a default domain name of .lan My server in question does not have it and I'd like to correct it. I must have overwritten something (or did something wrong). This server does not have a fixed ip address; it's set up for DHCP and ideally, I'd like to keep it that way. I'm looking for any and all ideas short of writing a script to fix it.

    When I use the commands:

    hostname -d


    sudo dnsdomainname --nis
    dnsdomainname: Local domain name not set

    If I ping it inside the server, it works:
    ping plex.lan
    PING plex.lan ( 56(84) bytes of data.
    64 bytes from HOSTNAME ( icmp_seq=1 ttl=64 time=0.053 ms
    64 bytes from HOSTNAME ( icmp_seq=2 ttl=64 time=0.068 ms
    64 bytes from HOSTNAME ( icmp_seq=3 ttl=64 time=0.067 ms

    HOWEVER, If I ping it from outside the server (but inside the lan) I get:
    ping plex.lan
    ping: cannot resolve plex.lan: Unknown host

    AND if I ping the hostname, it works:
    ping plex
    PING plex.localdomain ( 56 data bytes
    64 bytes from icmp_seq=0 ttl=64 time=0.588 ms
    64 bytes from icmp_seq=1 ttl=64 time=0.783 ms
    64 bytes from icmp_seq=2 ttl=64 time=0.798 ms

    My hosts file is:
    cat /etc/hosts localhost HOSTNAME plex.lan plex

    # The following lines are desirable for IPv6 capable hosts
    ::1 ip6-localhost ip6-loopback
    fe00::0 ip6-localnet
    ff00::0 ip6-mcastprefix
    ff02::1 ip6-allnodes
    ff02::2 ip6-allrouters

    My hostname file is:
    cat /etc/hostname

    Thanks for looking at this.

  2. #2
    Join Date
    Sep 2011
    Behind you!
    Ubuntu 20.04 Focal Fossa

    Re: cannot resolve Unknown host (when I add the domain to the hostname)

    If you want machines other than the server to recognize it, you will need to look at your local DNS server. For home environments, this is usually the Internet router which typically serves as the DHCP server as well...unless you are using a custom solution such as a Windows domain server or Linux.

    But before you get into how your DHCP and DNS servers communicate to each other, make sure your clients are not just stale to the new information. Release and renew the DHCP/DNS and test again.


  3. #3
    Join Date
    May 2013

    Re: cannot resolve Unknown host (when I add the domain to the hostname)

    Thanks for the reply!

    When I read your post, I said to myself, "I F!@#ing reset my router a dozen times!" plus, I've released and renewed the IP address on the client machine as many times as well!

    However, since I didn't put that info into my original post, I thought I owed it to the forum to completely clear the cache on the router (in this case, an UniFi USG). Unfortunately, clearing the DNS cache didn't help.

    BUT, I went one step further and replaced the router with a different one (to assign completely new IP addresses to everything within the network). With that, I humbly say you were right.

    Thank you for forcing me to do the extra due diligence.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts