Railway IP for domain A record
johnlins
HOBBYOP

10 months 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

10 months ago

3af4eb75-c9f3-4675-b813-0f3f3fc2b190


wilhall
HOBBY

10 months ago

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


johnlins
HOBBYOP

10 months ago

For context^

1358565845437251800


wilhall
HOBBY

10 months ago

Running a dig against the CNAME domain the setup instructions gives me (e.g. [something.up.railway.app](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```


wilhall
HOBBY

10 months ago

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


wilhall
HOBBY

10 months ago

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


wilhall
HOBBY

10 months ago

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

1358567121776541700


wilhall
HOBBY

10 months ago

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


wilhall
HOBBY

10 months 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

10 months 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



wilhall
HOBBY

10 months ago

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


johnlins
HOBBYOP

10 months ago

Oh, can't we just use ALIAS then?


johnlins
HOBBYOP

10 months ago

That would enable us to use TXT records


wilhall
HOBBY

10 months ago

You can if your DNS provider supports it


wilhall
HOBBY

10 months 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


wilhall
HOBBY

10 months ago

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


wilhall
HOBBY

10 months ago

So they are not guaranteed to work with all services.


johnlins
HOBBYOP

10 months ago

Ah I see


johnlins
HOBBYOP

10 months ago

That's so irritating


johnlins
HOBBYOP

10 months ago

Thanks


brody
EMPLOYEE

10 months ago

!s


Status changed to Solved brody 10 months ago


phin
EMPLOYEE

10 months ago

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


Status changed to Open Railway 10 months ago


phin

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

dima-kov
HOBBY

7 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!


brody
EMPLOYEE

7 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

7 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...