Railway IP for domain A record
johnlins
HOBBYOP

a year ago

I am currently using a CNAME to point to Railway for a custom domain. However, doing this make it impossible to setup SPF records, so I need to use an A record or ALIAS instead. But what is the railway IP address that I need to use for this?

26 Replies

johnlins
HOBBYOP

a year ago

3af4eb75-c9f3-4675-b813-0f3f3fc2b190


a year ago

I am also in need of this for 1f7cc3a8-76f3-47c2-beba-2b5bb6e4e202


johnlins
HOBBYOP

a year ago

For context^

1358565845437251800


a year ago

Running a dig against the CNAME domain the setup instructions gives me (e.g. something.up.railway.app) yields this: ```❯❯ dig qt0utsxf.up.railway.app

; <<>> DiG 9.10.6 <<>> qt0utsxf.up.railway.app
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 12971
;; flags: qr rd ra; QUERY: 1, ANSWER: 5, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;qt0utsxf.up.railway.app. IN A

;; ANSWER SECTION:
qt0utsxf.up.railway.app. 60 IN CNAME edge.railway.app.
edge.railway.app. 300 IN A 66.33.22.2
edge.railway.app. 300 IN A 66.33.22.1
edge.railway.app. 300 IN A 66.33.22.4
edge.railway.app. 300 IN A 66.33.22.3

;; Query time: 33 msec
;; SERVER: 192.168.1.1#53(192.168.1.1)
;; WHEN: Sun Apr 06 18:16:05 EDT 2025
;; MSG SIZE rcvd: 135```


a year ago

I'm going to test my app with those 66.33.22.* IPs as @ A records and see if that works


a year ago

Unclear if they are static IPs, but that fact that edge.railway.app has A records to four of them seems promising


a year ago

Aaaaand that does not work, yields an error due to the certificate not matching the domain

1358567121776541700


a year ago

I've been loving Railway, but unfortunately if this is not possible I will need to switch providers.


a year ago

This is a pretty huge restriction for anything other than hobby apps -- a little upset that "Custom Domain Support" is marketed when it's not actually supported fully.


johnlins
HOBBYOP

a year ago

Are you sure it's not fully supported? That would be pretty insane, that means you can't even have a custom email address if the root domain is hosted on railway



a year ago

They support CNAME flattening and ALIAS records, otherwise the docs say (unhelpfully) "just change your name servers!"


johnlins
HOBBYOP

a year ago

Oh, can't we just use ALIAS then?


johnlins
HOBBYOP

a year ago

That would enable us to use TXT records


a year ago

You can if your DNS provider supports it


a year ago

I'm not going to switch my DNS provider just because a PAAS product decided to not support the most straightforward DNS mechanism for domain redirection


a year ago

The problem is that all the mechanisms Railway supports (CNAME flattening, ALIAS records) are not standard DNS features


a year ago

So they are not guaranteed to work with all services.


johnlins
HOBBYOP

a year ago

Ah I see


johnlins
HOBBYOP

a year ago

That's so irritating


johnlins
HOBBYOP

a year ago

Thanks


a year ago

!s


Status changed to Solved brody 11 months ago


a year ago

You should be able to point your apex to 66.33.22.1 and it should work.


Status changed to Open Railway 11 months ago


phin

You should be able to point your apex to 66.33.22.1 and it should work.

dima-kov
HOBBY

8 months ago

Hi, I need to set up SPF records for my domain but Railway assigns dynamic IPs on each deployment.

You mentioned pointing apex to 66.33.22.1 - does this static IP also apply to outgoing emails from my app, or is there another way to handle SPF with Railway's dynamic IPs?

Thanks!


8 months ago

That IP is not used for outgoing traffic. For that, you would need to be on the Pro plan to enable static IPs.

https://docs.railway.com/reference/static-outbound-ips


brody

That IP is not used for outgoing traffic. For that, you would need to be on the Pro plan to enable static IPs.https://docs.railway.com/reference/static-outbound-ips

dima-kov
HOBBY

8 months ago

but it seems impossible due to:

Caveats

  • There is no guarantee that the IPv4 address assigned to your service is dedicated. It may be shared with other customers.

    so it's not safe


Loading...