Koozali.org: home of the SME Server

How to configure hostname for domainname.co.uk (no leading hostname)

Offline brianr

  • *
  • 988
  • +2/-0
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?
Brian j Read
(retired, for a second time, still got 2 installations though)
The instrument I am playing is my favourite Melodeon.
.........

Offline mmccarn

  • *
  • 2,627
  • +10/-0
Re: How to configure hostname for domainname.co.uk (no leading hostname)
« Reply #1 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...

Offline brianr

  • *
  • 988
  • +2/-0
Re: How to configure hostname for domainname.co.uk (no leading hostname)
« Reply #2 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.
Brian j Read
(retired, for a second time, still got 2 installations though)
The instrument I am playing is my favourite Melodeon.
.........

Offline Jean-Philippe Pialasse

  • *
  • 2,762
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: How to configure hostname for domainname.co.uk (no leading hostname)
« Reply #3 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

Offline brianr

  • *
  • 988
  • +2/-0
Re: How to configure hostname for domainname.co.uk (no leading hostname)
« Reply #4 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.
Brian j Read
(retired, for a second time, still got 2 installations though)
The instrument I am playing is my favourite Melodeon.
.........