Koozali.org: home of the SME Server

Obsolete Releases => SME Server 9.x => Topic started by: brianr on February 02, 2017, 06:44:32 PM

Title: How to configure hostname for domainname.co.uk (no leading hostname)
Post by: brianr on February 02, 2017, 06:44:32 PM
I cannot see a way to associate an external Ip address with the domain basename - i.e. "domainname.co.uk". Increasingly these days URLs do not include the "www", and I am confronted with the situation whereby a client needs to access a url which does not have a hostname the domain for which  is also resolved locally (for the purposes of receiving email on it).

Anyone got any ideas? - perhaps a custom template?
Title: Re: How to configure hostname for domainname.co.uk (no leading hostname)
Post by: mmccarn on February 02, 2017, 11:45:51 PM
Here's a forum post from 2014 (without any particularly useful solution):
https://forums.contribs.org/index.php?topic=50971.0


You might get what you want by creating a custom copy of
/etc/e-smith/templates/var/service/tinydns/root/data/50domainARecords

For testing -
- Copy the "A Records for domains" section from /var/service/tinydns/root/data
- Edit the entry for the domain you care about
- Save the results as:
/etc/e-smith/templates-custom/var/service/tinydns/root/data/50domainARecords

If that works and doesn't break anything else, you could create a new db variable, then customize the existing script to use the new variable if it exists, or $LocalIP (as it does now) if there is no external IP set...
Title: Re: How to configure hostname for domainname.co.uk (no leading hostname)
Post by: brianr on February 10, 2017, 12:37:04 PM
This was all very interesting, but I have to admit I fixed it by copying the website to the local server, rather than trying to get the re-direct working.
Title: Re: How to configure hostname for domainname.co.uk (no leading hostname)
Post by: Jean-Philippe Pialasse on February 10, 2017, 03:35:37 PM
I cannot see a way to associate an external Ip address with the domain basename - i.e. "domainname.co.uk". Increasingly these days URLs do not include the "www",

you should also note that browser tend to hide the www. and http or https these days, so this could be a wrong impression too ;)

however, i do not understand what you where trying, redirecting to external server, proxypass to another lan server, or simply change the default domain of the server to avoid the hostname ?

for the last it is simple :

Code: [Select]
config set DomainName yourdomain.tldthen signal-event domain-modify and email-update. be careful it might also need some modifications for the SSL certificates
Title: Re: How to configure hostname for domainname.co.uk (no leading hostname)
Post by: brianr on February 11, 2017, 01:25:26 PM
however, i do not understand what you where trying, redirecting to external server, proxypass to another lan server, or simply change the default domain of the server to avoid the hostname ?

It was definitely a URL without "www" that I needed to redirect to an external server. I could not use an "inplace" redirect as the URL was followed by a set of post(?) parameters, and the DNS entry for the unadorned URL is not accessible via the Server manager Hostnames and domains panel.