Hostname on FreeBSD installation

Status
Not open for further replies.
B

badbrain

Guest
Unlike any previous time I just hit enter when the installer ask for hostname since I'm install it on a VirtualBox VM. This time I decided to give a hostname, blackdog. The installation goes smoothly but after boot up it said "Unqualified hostname" and refused to boot. This made me confused. On other BSDs I usually set hostname to blackdog and domain name to bsd.local and it just fine. Does FreeBSD expect hostname to be domain name on other BSDs? I think they're clearly different thing.
 
It seemed it really expect hostname to be domain name on other bsd. I reinstall it with hostname set to blackdog.dom and it boot up happily. Isn't it somewhat strange?
 
It seemed it really expect hostname to be domain name on other bsd.

No it doesn't. Puuhh...

For many years I was telling people that the hostname and a domain name are two entirely different things (mostly to no avail).
And yes, the hostname traditionally did not have a domain extension. It's a bit strange that FreeBSD requires such. Probably people have just given up to explain the difference, like me.

But even as FreeBSD seems to require the hostname to have a domain extension, this is NOT a domain name in regard to networking! It is still a fully independent name that only suits as a label for the machine or the OS instance (even if it would not have any networking attached). Whereas the usual domain names are labels for a network address (and there can be none or many on a certain machine).
 
Great topic. I do not use FQDN for my hostnames.
x9srl
x10sri
E6420
These are a short sample. I use motherboard/computer model as hostname. No Extention used ever.
The domain extension always confused me for a computer (host)name.
 
You really don't need to reinstall to change the hostname, just edit /etc/rc.conf and edit hostname="<something>". That's all that needs to be done.
If it ever allow me to log in ;) It said I've an "Unqualified hostname" and refused to boot. If having to choose between messing with single user mode, import zpool, mount,... and a clean reinstall I would choose the later :)
 
The warning comes from sendmail as it wants FQDN and the one that can be resolved. However, it doesn't actually refuse to boot, saying it's "sleeping", and simply pressing Ctrl+C would allow the startup to continue, and then you can disable it (sendmail) completely in rc.conf.
 
This made me confused.
You're not alone. To preserve my sanity (as opposed to my purity) in dealing with unadorned host names (UHN) and fully qualified domain names (FQDN) I have a few simple rules:
  1. FreeBSD hosts get "hostname=FQDN" in /etc/rc.conf. Don't fight it...
  2. Debian (derived) hosts get an unadorned host name (UHN) in /etc/hostname.
  3. Other Linux hosts generally get a FQDN in /etc/hostname.
  4. Any entries added to /etc/hosts always have "IP FQDN UHN [alias ...]" meaning that the canonical name is the FQDN.
  5. The internal DNS resolver is configured to resolve UHN to FQDN (at home, it's actually dnsmasq on the firewall configured to resolve from the local /etc/hosts file first).
  6. Debian systems will install with "127.0.1.1 FQDN UHN in /etc/hosts" which gets commented out after 5 above (mainly to eliminate surprise for the uninitiated).
Cheers,
 
You've completely disabled sendmail(8) which, to the best of my knowledge, is the only service that requires an actual FQDN for the hostname. It doesn't need to exist (as long as it resolves locally) but it does require a hostname with at least one dot in it.
 
This is great entertainment. I really enjoy.

We already have the option in /etc/src.conf for not getting seduced to read the documentation.
Code:
WITHOUT_MAN

But there really should be a knob in /etc/rc.conf for those wanting more fun:
Code:
stop_parsing=YES
 
Personally I always set the hostname to be the same as the FQDN, even if they don't have to be the same, from a theoretical point of view. Apart from making sendmail happy from the start, it also avoids potential problems later on. And it avoids an additional resolver query (possibly including a DNS round-trip, depending on setup) each time a program wants to get the FQDN.
 
I've always been a little confused between hostname and FQDN. In any case I just use the configuration as previously noted and I don't use sendmail so I guess I shouldn't worry about it.
 
This is all I use:
/etc/rc.conf
sendmail_enable="NONE"
hostname="E6420"
I monitor software and hardware health, and report issues with sendmail.

There is no better example of this than smartd.

So a typical physical build for me has:

In /etc/rc.conf:
Code:
hostname="somehost.my.domain"
smartd_enable="YES"
sendmail_enable="YES"
In /etc/mail/sendmail.cf:
Code:
DS=mailhost.my.domain
In /usr/local/etc/smartd.conf:
Code:
DEVICESCAN -a -o on -S on -n standby,q -s (S/../.././02|L/../../6/03) -W 4,50,50  -m root
In ~/root/.forward:
Code:
my.name@mailhost.my.domain

Just two days ago, I picked up a failing disk on my main virtualisation server :cool:
 
I've never used anything but my chosen machine name and set /etc/alias to deliver to me as root:

Code:
hostname="unmei"
sendmail_enable="NO"


root:    jitte@unmei

I need to be root to open my security report but get it daily like clockwork.
 
Status
Not open for further replies.
Back
Top