Ngrok custom hostname add cname to subdomain
Solution 1
Some DNS providers allow you to make a CNAME record instead of a A record for a apex domain (http://xyzfoo.com). CloudFlare is one example that allows this. These DNS providers would let you point your http://xyzfoo.com to your http://randomstuffabcd.ngrok.com.
Solution 2
Because Ngrok uses the Host
header sent by the browser to determine how to redirect your traffic you will need to "reserve" the domain you want to use in the Ngrok dashboard. Note that doing this requires a paid Ngrok plan.
After reserving your domain you will be given a CNAME record to point it to.
Related videos on Youtube
phillipsk
Updated on September 18, 2022Comments
-
phillipsk almost 2 years
I have
xyzfoo.com
domain. I created a DNS CNAME record which points tongrok.com
I have my app running locally onhttp://127.0.0.1:5000/
but not running remotely onzyxfoo.com
Does a subdomain need to be used with a custom hostname on
ngrok
? Creating a subdomain seems like a hassle through my current hosting provider, I have an extra domain laying around and I do not mind using the domain solely for testing withngrok
I have a dedicated IP address and a SSL certificate. On my parent domain,
xyzfoo.com
I have also created a sub domainfoo.xyzfoo.com
through which I have also created a CNAME record for, with hostnamecname-for-ngrok
and value offoo.xyzfoo.com
I have two routes as I trying to get the custom hostname from ngrok to work, I am troubleshooting two ways,the
foo.xyzfoo.com
andxyzfoo.com
are reserved domains on my ngrok dashboard. When I refresh my parent or subdomain I am not seeing my applicaiton, nor any activity on my terminal logs. -
Artistan almost 6 yearssome also allow for a low TTL so it will update more frequently if you have to restart ngrok and have it update quickly.