How to use custom domain name for my gateway?

Hi,
Is there any document available to use custom domain names for my webthing gateway ?

As in, use something other than the *.mozilla-iot.org domain? You’d have to do something like the following:

  1. Set up your domain somewhere, pointing a DNS record to your IP address.
  2. Forward ports 80 and 443 on your router to the gateway.
  3. Set up certificates as desired. You can generate a self-signed cert with tools/make-self-signed-cert.sh, or you can use an ACME (Let’s Encrypt) client.

Thanks @mrstegeman

I agree with this method, but my router’s public ip is not static all the time as it keeps changing timely and I would like to do without port forwarding my router just like how mozilla’s subdomain is working, can you help me in this regard ?

In that case, you can use a dynamic DNS client to keep your DNS record updated.

If you want to do what we’re doing, you can use PageKite.

Another option would be:

  1. host a VPN somewhere in the cloud with a static IP
  2. point your DNS record to that host
  3. forward traffic from that host, across the VPN to your gateway
1 Like

Thanks @mrstegeman
This is a good option to do for a single gateway.
Let’s say If I have multiple gateways and I need sub-domain for each gateway, Can I point my wildcard DNS record to this VPN host ? How can I configure sub-domains for each of my gateways ? Please assist, thanks

Yes, you could use a wildcard. You’d have to use a reverse proxy on the VPN host to route traffic to the appropriate tunnel, depending on the requested domain name.

For instance:

  1. Set up VPN
  2. Configure *.example.com to point to your VPN host
  3. Set up VPN clients on each gateway, have them auto-connect
  4. Set up reverse proxy on your VPN host such that gateway1.example.com gets routed to 10.0.0.2 (VPN tunnel 1), gateway2.example.com gets routed to 10.0.0.3 (VPN tunnel 2), etc.
1 Like

Thanks @mrstegeman
I am trying the registration server now to do the same thing using pagekite as i felt that is the best solution to use custom domain names. I have configured the nameservers, now I am bit uncler about nginx as I am new to it. What is this api.xyz.com in the nginx.conf file, do i need to create it or it will be auto created ? when i change my name severs like below
ns1.xyz.com & ns2.xyz.com
In godaddy, I can’t manage the DNS records and can’t add wildcard as the nameservers are not default from godaddy now. Could you please assist me ??

and also I am bit unclear about the email in the config.toml file, how can I set it ?? I was already using a e-mail server(MX) for this domain name, Please help…
image

Thanks,

To be clear, I wasn’t suggesting that you run your own registration server. I was just saying that you could run PageKite yourself. You’d have to run the PageKite server in the cloud somewhere.

If you want to go the full registration server route…

The api subdomain is what the gateway talks to when setting up domains and such. Every other subdomain (except for www) is available for registration. nginx is just used as a reverse proxy for the registration server, primarily because we run several other services on the same host (such as the add-on and update proxies).

The registration server serves as the DNS resolver for the full domain, so your NS records must be set up to point to it. If GoDaddy won’t let you do that, you’ll need to look at hosting your domain elsewhere.

1 Like

Thanks @mrstegeman
I have tried running pagekite in cloud and backend in my clients, it’s working perfect as i expected. Thanks for your help on time.