Support Forums

Netlify change my DNS name to IP adress when deploy my site

When I deploy my site from Gitlab to Netlify I set an environment variable to connect my API as DNS name list (https://examle.com) but when deploy, Netlify build the Website via Gatsby build and return an error like connection time out to the IP address not to the DNS name , I am sure that I pass the DNS name not the IP to the API URL variable .

Please any advice?

Hi @Hasan

Generally speaking, any environment variable you set remains the same—they are not changeable at build time.

Are you able to share an example of how you are using this variable in your code, your real site (not example.com) and your git repository?

this is my case 2

the environment variable is the API_URL and it shown its right but the connect to IP and return an SSL issue

I don’t believe it is using the IP address to connect to, I believe it is simply returning the IP address when it fails (ie. is timing out.)

when I am work locally its work successfully , it show this error only when deploy on Netlify ,
Are you have any idea why this happen only when deploy on Netlify ?

Without seeing and testing your code (ie. deploying it) I cannot say. I am also not as proficient in Gatsby as some others on the forums.

Thanks for your support , I change my API to another server then it work successfully

1 Like

Glad to hear this is working for you, @Hasan :netliconfetti:. Thanks for the great advice here, @coelmay!

1 Like