this post was submitted on 11 Nov 2024
25 points (90.3% liked)

Selfhosted

40407 readers
202 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 2 years ago
MODERATORS
 

Hi guys!

I'm considering moving away from duckdns, as it's becoming increasingly unreliable. I'd like to check some other free dynamic DNS alternatives (I'm open to suggestions!).

My idea would be to have the server run under two different domains, but both directing to the same services. Is this possible? What shoudl I change in nginx in order to answer to two different domains/names?

Thanks!

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 5 points 2 weeks ago* (last edited 2 weeks ago) (1 children)

I switched from duckdns about a year ago as it failed to resolve the addresses for my jellyfin server. I ended up buying a domain from cloudflare for 3 years for about $4, and I self-hosted ddns updater to automatically grab the dynamic ip, and set it to a subdomain.

As for your nginx config, I'd imagine you could make 2 separate config files in sites-enabled that are nearly identical, but listen for different domains. Something like this:


#config file 1 
server {
    listen 80;
    server_name example_a.com;

    location / {
        return 301 http://example_c.com$request_uri;
	#or use an ip instead of example_c.com
    }
}

#config file 2
server {
    listen 80;
    server_name example_b.com;

    location / {
        return 301 http://example_c.com$request_uri;
	#or use an ip instead of example_c.com
    }
}


#Or use "proxy_pass http://example_c.com;" in the location tag instead of "return 301..." if you want to reverse proxy the traffic

[–] [email protected] 2 points 2 weeks ago (1 children)

Thanks. I'm seriously considering also a paid domain, so it's good to hear from your experience. I might go try some other free provider first though.

[–] [email protected] 3 points 2 weeks ago

I switched to a paid domain in the last few months and regret not doing it sooner - it just works, and it's nice knowing that I won't have to reconfigure all my stuff to point at a different domain name again in the future. Price was maybe $15/year on porkbun - very much worth it imo.

I've also used freedns in the past and had no complaints about them, except that I think wildcard subdomains are limited to paid supporters (very cheap though) and at the time my SWAG docker image maybe didn't support them? It's been a while. The service was great though. Never had problems like I did with duckdns.