# sendmail and unqualified host name



## abarmot (Nov 18, 2008)

Installed new FreeBSD 7. while first boot it shows: unqualified host name (hostname) unknown; sleeping for retry.
after CTRL+c /etc/rc.d/sendmail interrupted

google said that problem is in /etc/hosts file. and probably in /etc/nsswitch.conf but i can't find error in it.

please see my configuration files.
*hostname# cat /etc/rc.conf*

```
defaultrouter="192.168.1.1"
hostname="hostname"
ifconfig_vr0="inet 192.168.1.3  netmask 255.255.255.0"
keymap="us.iso"
sshd_enable="YES"
```

*hostname# cat /etc/hosts*

```
::1                     localhost
127.0.0.1               localhost
192.168.1.3             hostname
192.168.1.3             hostname.
```

*hostname# cat /etc/nsswitch.conf*

```
group: compat
group_compat: nis
hosts: files dns
networks: files
passwd: compat
passwd_compat: nis
shells: files
services: compat
services_compat: nis
protocols: files
rpc: files
```

Where can be a problem?
thanks for any help.


----------



## SirDice (Nov 18, 2008)

hostname needs to be something like myhost.mydomain.home
It doesn't really matter if the domain is actually valid or not. Sendmail just needs something to base it's domain on.


----------



## abarmot (Nov 19, 2008)

SirDice said:
			
		

> hostname needs to be something like myhost.mydomain.home
> It doesn't really matter if the domain is actually valid or not. Sendmail just needs something to base it's domain on.



you are right.
i works!
thanks!!


----------



## carlton_draught (May 30, 2010)

SirDice said:
			
		

> hostname needs to be something like myhost.mydomain.home
> It doesn't really matter if the domain is actually valid or not. Sendmail just needs something to base it's domain on.


Thanks SirDice, you saved my bacon. I was getting the same thing on startup and my keyboard was refusing to output anything after about 1 minute into login, until this was fixed. Very frustrating!


----------



## mybox_and (Apr 28, 2013)

*unqualified host name*



			
				SirDice said:
			
		

> hostname needs to be something like myhost.mydomain.home
> It doesn't really matter if the domain is actually valid or not. Sendmail just needs something to base it's domain on.



Does the condition so hardly recommended to implement?

During installation I entered only myhost (of course it was my hostname), not like in format described above. During installation I configured WiFi connection. I used FreeBSD for a short time and decided to change the network connection to ethernet. The WiFi connection was switched off. The ethernet adapter was configured via sysinstall.

rc.conf

```
# -- sysinstall generated deltas -- # Sun Apr 21 15:30:25 2013
ifconfig_bge0="DHCP"
#hostname="freebsd630"
```
I decided to comment 
	
	



```
#hostname="freebsd630"
```
 generated by sysinstall, because rc.conf already has this string.

During a reboot the system shows the following messages:


```
...
Setting hostname: freebsd630.
...
freebsd630 sm-mta[2051]: My unqualified host name (freebsd630) unknown; sleeping for retry
freebsd630 sm-mta[2051]: unable to qualify my own domain name (freebsd630) -- using short name
freebsd630 sm-msp-queue[2900]: My unqualified host name (freebsd630) unknown; sleeping for retry
freebsd630 sm-msp-queue[2900]: unable to qualify my own domain name (freebsd630) -- using short name
...
```

I've checked /etc/hosts and found:

```
#172.20.234.39          freebsd630.
```
I commented the string, but still receive the  messages posted above.

Also when I log as su I receive a message on the screen:


```
You have mail.
```

Is it possible to use only myhost on the local machine? If yes, which setting should be checked? Either the myhost.mydomain.home format is strongly recommended  and/or it is the right way to prevent further problems?

Best regards,

P.S. Sorry for my terrible English.


----------

