Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am ultimately trying to setup an SSL certificate.
My domain name is like example.com not something.example.com
How should I configure my hostname without a sub-domain? The main reason is that I need to give domain names and aliases to register to certbot and to httpd.
I am ultimately trying to setup an SSL certificate.
My domain name is like example.com not something.example.com
How should I configure my hostname without a sub-domain? The main reason is that I need to give domain names and aliases to register to certbot and to httpd.
You can create certificate(s) for just example.com, or something.example.com or even *.example.com, with letsencrypt
Take a look at this howto for example
I know that I can specify domain names with the -d option, But, it complains if those are not resolved domain names or aliases served by my web server, I think.
The domain names and aliases are derived from hostname.
So, how do I configure a hostname, if it is not a sub-domain?
I know that I can specify domain names with the -d option, But, it complains if those are not resolved domain names or aliases served by my web server, I think.
The domain names and aliases are derived from hostname.
So, how do I configure a hostname, if it is not a sub-domain?
I'm not following how those allow me to have a host name without a sub-domain. Could you elaborate?
Did you read the resolv.conf manpage at the link in my previous post?
If you use the search/domain directive in resolv.conf (e.g. search example.com), when you do a lookup for "blah" the resolver will actually resolve blah.example.com
If you don't use dns, you can achieve the same result with the hosts file (/etc/hosts)
Did you read the resolv.conf manpage at the link in my previous post?
If you use the search/domain directive in resolv.conf (e.g. search example.com), when you do a lookup for "blah" the resolver will actually resolve blah.example.com
If you don't use dns, you can achieve the same result with the hosts file (/etc/hosts)
Right. That is what I am trying to avoid. My domain name is like example.com not blah.example.com. The hostname is used in various configuration files. If I set the hostname to "example" it resolves to example.example.com, which is also wrong.
How do people configure DNS and httpd and let's encrypt when their FQDN does not include a sub-domain?
Neither Certbot nor Apache cares what your server's actual hostname is.
First step is DNS - setup an A record for "@" on the nameservers example.com uses, pointing at the IP address of your server (or firewall/loadbalancer/etc).
Next step is to configure Apache Httpd with your example.com as a VirtualHost (using appropriate SeverName and ServerAlias values). (Until DNS resolves, you can setup your local /etc/hosts to mimic the A record and test Apache is working, or even do it before changing the DNS.)
Once the DNS has resolved (anywhere from minutes to 48 hours), and assuming appropriate permissions/etc, Certbot will be able to issue your certificate.
If there are issues, Certbot will error but you can simply resolve the issues then re-run it.
Neither Certbot nor Apache cares what your server's actual hostname is.
This is the definitive answer. OP, you don't need to do anything about your hostname.
Set up DNS as boughtonp has suggested. Set up apache to respond to the names you want. The SSL cert will contain the name as you've defined it in DNS and apache. hostname doesn't enter into it anywhere...it could be localhost or myserver instead of example.com and wouldn't matter.
On my production server, I've set the hostname to example.com, but all the virtual domains I host resolve and display just fine, even tho, except for one of them, the hostname is not the same as the domain name.
Thank you! Apparently, I was confused by hostname appearing in various configuration files and a left over let's encrypt configuration file that failed to renew because the machine used to have a sub-domain name.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.