# I'm befuddled by hostnames and FQDNs



## JayArr (Dec 23, 2015)

I should probably know the answer to this but my brain has turned to mush and two hours of googleing has just made it worse.

What are the rules concerning naming computers inside a firewall on a local network?

I've just been giving them single names (after cigars - Partagas, Bolivar, MonteCristo) It's worked for the last fifteen years but I've never had a machine other than my desktop try to email out messages.

Now I want sendmail to work on the new finance computer since one of it's features is to email an invoice from the server (as opposed to creating a .pdf to send from my desktop) The trouble is that the server is throwing an error because the server doesn't have a FQDN.

`Warning: Local host name (partagas) is not qualified`

I have a website but it is hosted and external and so mycompanyname.ca is already resolved to that address.

On top of all that the finance server is inside a Monowall firewall. 

The Partagas server's address is 192.168.XX.XX inside a firewall attached to a telco ISP line at static IP xxx.xxx.xxx.xxx and unrelated to mycompanyname.ca at static IP yyy.yyy.yyy.yyy

Can I still call my server Partagas.JRElectronics.ca? or do I need a new name like JRElocal.ca

I'm kind of ashamed to have to ask such a basic question, I guess it's something I never fully figured out before.

Jeff


----------



## drhowarddrfine (Dec 23, 2015)

Funny you should bring this up since I was going to do the same today with my similar but unrelated question (so I hope I'm not hijacking).

I don't use sendmail on my desktop machine and always set the hostname to "doc" in /etc/rc.conf. That's been fine for over a year. A few days ago, when I turned my machine on in the morning, boot up hung and complained about my hostname not being a fqdn and it's done that every day since.

So I think something has changed just recently but I don't know what it is.


----------



## JayArr (Dec 23, 2015)

Hey drhowarddrfine 

I don't know if this helps you but I did some more searching, (on hostname this time instead of servername), and I came up with a post that 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.



It was by SirDice, here:

https://forums.freebsd.org/threads/sendmail-and-unqualified-host-name.323/

So I just edited my rc.conf file and made


```
hostname="Partagas.mycompanyname.ca"
```

Then I rebooted and tried it out and it all seems OK.

JayArr


----------



## tingo (Dec 23, 2015)

As long as you are only sending mails on your local network, the domain name doesn't matter.
If you start sending email to external parties (like anyone on the Internet) every receiving mail server will check things like; DNS name matches reverse DNS lookup, if the IP address of the machine sending email is dynamic or static, and more. This makes it hard for people with just a private setup with dynamic IP address to run their own mailserver.


----------



## drhowarddrfine (Dec 23, 2015)

JayArr Yeah, I'm aware of that. I'm not really a sysadmin and used to have someone else do that stuff for my company. These are things he set up, long ago, and I've not had to deal with them till now. 

While I'm aware how that is should be set up, I don't understand how I got away with just using "doc" all this time without issue.


----------



## kpa (Dec 24, 2015)

drhowarddrfine said:


> JayArr Yeah, I'm aware of that. I'm not really a sysadmin and used to have someone else do that stuff for my company. These are things he set up, long ago, and I've not had to deal with them till now.
> 
> While I'm aware how that is should be set up, I don't understand how I got away with just using "doc" all this time without issue.



Your configuration changed somehow in such a way that short names are no longer completed to the FQDNs by the resolver(3). This is what the domain and search directives are for in resolv.conf(5). You can always add the names to /etc/hosts so that the short names are always recognized and do not depend on DNS. Like this:


```
...
127.0.0.1 doc.mydomain.tld doc
...
```


----------

