I am wondering if there is a way to reset the dyno IP on Heroku when I want.
I noticed sometimes it changes when the application is restarted. However, not always.
How can we reset the dyno IP address on restart every time?
I already saw these questions:
Does Heroku change dyno IP during runtime?
https://www.quora.com/Do-Heroku-dynos-get-new-IP-addresses-when-redeployed-or-restarted
It turns out by restarting the app (deleting the dynos), the IP is changed, by default.
You can do this by using the Heroku API.
Related
As far as I know, Heroku has dynamic outbound IP addresses. But when I try to make a PHP script that requests https://ipinfo.io/ip via curl the IP doesn't seem to change.
When I push new commits the IP address does change, and when I run heroku run bash and run curl from there I always see a new IP.
Why does the IP not change when I run my PHP script from my browser, but it does change when I run curl via bash?
When you run something via heroku run it runs in a one-off dyno. This dyno is separate from the dyno(s) where your web server is running. It will therefore have a different IP address. Each time you run heroku run bash you get a brand new one-off dyno, resulting in a new IP address.
When I push new commits the IP address does change
Similarly, pushing changes to Heroku causes a new slug to be built and your application to be restarted.
You should be able to see similar behaviour if you simply restart your application, e.g. via heroku restart.
Let me keep this as simple as possible. I have looked at a bunch of other posts related to this but haven't found an answer :(. I am hosting my web app on Heroku and using Gandi as my domain provider.
Note: The top answer from this post is what I used as my basis.
A few days ago I set up web forwarding on Gandi so that my mydomain.gg forwards over to www.mydomain.gg. I also set up custom domains in Heroku. It looks like this:
*.mood.gg wildcard.mood.gg.herokudns.com
www.mood.gg www.mydomain.gg.herokudns.com
mood.gg mydomain.gg.herokudns.com
I then went into Gandi and added these to my zone file so it looks like this:
# A 217.70.184.38
* CNAME mydomain.gg.herokudns.com.
www CNAME www.mydomain.gg.herokudns.com.
The A tag is there for the web forwarding where the IP points to a Gandi IP. Heroku changes IP addresses frequently, which is why I use CNAME.
Cool!
This all worked perfectly for 3 days, where I didn't touch my zone file or Heroku app for those 3 days at all.
So here is where the oddness begins. I upgraded my Heroku server to a more expensive plan and pushed some new code to it as well. A few hours later, my root domain mydomain.gg breaks and doesn't forward over to www.mydomain.gg. If I go directly to www.mydomain.gg it works perfectly.
So my question comes down to, where did this break? I never touched my Gandi zone file. All I did was push to my Heroku server and it seemed to break the web forwarding with Gandi. How did pushing to Heorku cause something to mess up with Gandi where all I'm specifying is a Heroku DNS that didn't change at all?
Another thing is, Gandi says they don't support naked domain CNAMEs which is why I use web forwarding. But then whats the point of this line in my zone file:
* CNAME mood.gg.herokudns.com.
Any help would be appreciated!
Simply speaking, I need to delete and re-create my Heroku app. If I add Proximo addon to a new app and set my old PROXIMO_URL env var there
PROXIMO_URL: http://proxy:...#proxy-....proximo.io
Will it work as expected? Will my new app get the old proxy IP address?
The IP address of your proxy unfortunately cannot be preserved between applications due to limitations of the Heroku addon system.
This is doubly true across regions, unless you would want to use a proxy in a different region which seems unlikely.
The best bet for you would probably be to go ahead and create the app in the other region and add Proximo to it. You could then get the new IP address whitelisted wherever necessary.
I have an application deployed to Heroku. I'm using a service that requires me to access their SFTP server using a static ip address. I know Heroku dynos are unreliable in this regard. I have successfully achieved this using the Proximo addon, however, its too expensive for the amount of traffic that I'll be sending (around 500 MB/month). Is there an alternate to this? I'm inclined towards using an EC2 instance but not quite sure what's required to create a proxy or whatever.
I'd go with an EC2 micro instance; pushing bits around doesn't really consume much CPU, so it's unlikely to get throttled. I would then give that instance an elastic IP address and communicate that address to the other service. (Whatever I choose to do later, I can always spin up another instance and associate it to that IP.) I would then deploy a SOCKS proxy (Dante?); SOCKS has pretty widespread application support, and it can handle SFTP just fine.
From here, there are a couple details specific to Heroku -- for one, you'll want to configure your proxy server's EC2 security group such that Heroku can access it (see Dynos and the Dyno Manifold). You'll also want to enable authentication on the SOCKS server, since granting Heroku access to your proxy grants everyone in Heroku access to your proxy. Then, heroku config:set SOME_SERVICE_SOCKS_PROXY=socks://user:pass#ip-10-1-2-3.ec2.internal, and have your application look for that environment variable and do the right thing.
You'll likely be paying $0.01/GB for intra-region data transfer between your proxy and Heroku, since statistically, your application will be in a different availability zone most of the time. Heroku dynos last about 24 hours in production, so while the exact location will dance around unpredictably, it'll probably land in the $0.008/GB range in aggregate. You'll also be paying for the micro instance itself (though reserved instances make them stupid cheap) as well as the usual AWS Internet data transfer rates.
I'm trying to setup a custom domain for my Heroku Cedar stack app, but it's not working.
I've tried entering 'host www.mydomain.com' command' in Terminal, but it yields no output.
I've already changed my DNS settings and added a 'CNAME' host: www, direct to: my domain.herokuapp.com but still it's not working.
What could I be doing wrong here???
Thanks,
Faisal
The fact that you're not getting any results in terminal for host then the problem lies with your DNS settings - it sometimes takes a while for updates to propogate across the internet, I usually allow for 24 hrs to be sure. If it still doesn't work then you should get in touch with your DNS host.
You also have to add domain entries to your Heroku app:
heroku domains:add yourdomain --app yourapp
The "-app yourapp" is not required if you are in the root directory of your Rails app.
You can repeatedly add more than one domain to your Heroku app.
Here is an article about adding custom domains and DNS setup, at the Heroku Dev Center:
https://devcenter.heroku.com/articles/custom-domains