rdcence
September 1st, 2021, 03:17 AM
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
plex
hostname -d
lan
dnsdomainname
lan
sudo dnsdomainname --nis
dnsdomainname: Local domain name not set
If I ping it inside the server, it works:
ping plex.lan
PING plex.lan (127.0.1.1) 56(84) bytes of data.
64 bytes from HOSTNAME (127.0.1.1): icmp_seq=1 ttl=64 time=0.053 ms
64 bytes from HOSTNAME (127.0.1.1): icmp_seq=2 ttl=64 time=0.068 ms
64 bytes from HOSTNAME (127.0.1.1): 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 (192.168.1.21): 56 data bytes
64 bytes from 192.168.1.21: icmp_seq=0 ttl=64 time=0.588 ms
64 bytes from 192.168.1.21: icmp_seq=1 ttl=64 time=0.783 ms
64 bytes from 192.168.1.21: icmp_seq=2 ttl=64 time=0.798 ms
My hosts file is:
cat /etc/hosts
127.0.0.1 localhost
127.0.1.1 HOSTNAME
127.0.1.1 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
plex
Thanks for looking at this.
When I use the commands:
hostname
plex
hostname -d
lan
dnsdomainname
lan
sudo dnsdomainname --nis
dnsdomainname: Local domain name not set
If I ping it inside the server, it works:
ping plex.lan
PING plex.lan (127.0.1.1) 56(84) bytes of data.
64 bytes from HOSTNAME (127.0.1.1): icmp_seq=1 ttl=64 time=0.053 ms
64 bytes from HOSTNAME (127.0.1.1): icmp_seq=2 ttl=64 time=0.068 ms
64 bytes from HOSTNAME (127.0.1.1): 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 (192.168.1.21): 56 data bytes
64 bytes from 192.168.1.21: icmp_seq=0 ttl=64 time=0.588 ms
64 bytes from 192.168.1.21: icmp_seq=1 ttl=64 time=0.783 ms
64 bytes from 192.168.1.21: icmp_seq=2 ttl=64 time=0.798 ms
My hosts file is:
cat /etc/hosts
127.0.0.1 localhost
127.0.1.1 HOSTNAME
127.0.1.1 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
plex
Thanks for looking at this.