Railway IP for domain A record

johnlins
HOBBY

6 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?

4 Replies

johnlins
HOBBY

6 months ago

3af4eb75-c9f3-4675-b813-0f3f3fc2b190


6 months ago

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


johnlins
HOBBY

6 months ago

For context^

1358565845437251800


6 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```


6 months ago

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


6 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


6 months ago

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

1358567121776541700


6 months ago

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


6 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
HOBBY

6 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



6 months ago

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


johnlins
HOBBY

6 months ago

Oh, can't we just use ALIAS then?


johnlins
HOBBY

6 months ago

That would enable us to use TXT records


6 months ago

You can if your DNS provider supports it


6 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


6 months ago

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


6 months ago

So they are not guaranteed to work with all services.


johnlins
HOBBY

6 months ago

Ah I see


johnlins
HOBBY

6 months ago

That's so irritating


johnlins
HOBBY

6 months ago

Thanks


6 months ago

!s


Status changed to Solved brody 6 months ago


5 months ago

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


Status changed to Open Railway 5 months ago


phin

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

dima-kov
HOBBY

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


2 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

2 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


Railway IP for domain A record - Railway Help Station