SRV Record Problems
I am new to DNS and am trying to host a few publicly accessible servers. I purchased a domain with namecheap and have created the following DNS records:
A record with host "@" pointing to my public IP
A record with host "subdomain" pointing to my public IP
SRV record with the following parameters: Service: _minecraft Protocol: _tcp.subdomain Priority: 0 Weight: 5 Port: port_of_server Target: subdomain.domain.tld
I am able to connect to my server using subdomain.domain.tld:port_of_server but am unable to connect using just subdomain.domain.tld as I wish; I get a "Connection refused: getsockopt" message in Minecraft. Any suggestions?
75 Replies
Thanks for asking your question!
Make sure to provide as much helpful information as possible such as logs/what you tried and what your exact issue is
Make sure to mark solved when issue is solved!!!
/close
!close
!solved
!answered
Requested by treesone#0
Just to sanity check, this is java edition right?
yes
What domain registrar are you using?
namecheap
I can say that I wasn't totally sure what to put in the target field - I don't know if it should be "subdomain", "subdomain.domain", or "subdomain.domain.tld"
does it work if they just put in the IP and port?
yes it does
it also works if they put "subdomain.domain.tld:port"
so "subdomain.domain.tld" is resolving correctly with my A record I think
its just not getting the port number from the SRV (I think)
can you dm me the srv that they're typing into minecraft so I can check if it's setup correctly
ye
okay, so basically, if you open your terminal and type
nslookup -type=srv _minecraft._tcp.subdomain.example.com 1.1.1.1
you should get
as the result
I did that lookup on your domain and the record does indeed appear to be invalidalright so what do I need to do?
you said the protocol is
_tcp.subdomain
, is there no "name" field or somethingNo. I'll dm u what the UI looks like
Potentailly of note, if I run
I do get the expected response
And checking now I am actually able to connect on minecraft to example.com even on this non-default port number. I'd like to get it to connect to subdomain.example.com, though
so that I can host several servers
Likely your router or PC just has the dns record cached then
ipconfig /flushdns
if it's your computer
if it's your router, you can wait, or just reboot it
In theory could be your ISP
So you could just update your PCs DNS to 1.1.1.1 and 8.8.8.8
hmmm
namecheap's article does appear to imply that you should be able to see the subdomain inside of the protocol part of the field
it does, check the comments though
any thoughts on this? Does this mean I have a working SRV record but pointing to the wrong thing?
I will say, I've never had any issues with cloudflare's DNS. It's completely free to use and really easy to setup
they give free domains?
but I may just be biased
no, they just provide free dns nameservers
and a lot of other stuff, but it doesn't matter for minecraft
so what would that mean for me - it makes it a place where i can create the records?
yeah
do i need to do some domain transfer or something?
nah, you just change the nameservers, cloudflare will tell you how to do it
just a moment ill try it out
if you do end up using cloudflare though, make sure to disable the cloudflare proxy on minecraft related subdomains
What does that mean?
they have anti ddos stuff, but it doesn't matter for minecraft and isn't compadible
understood
so is the hope that by switching to cloudflare ill be able to enter the SRV record without bugs?
they just give you one big field to type the entire srv record into now
can you dm me the format that needs to go in?
I mean you can see that right there
the blurred part is just
example.com
alright ill try
Got it. How is this possible by the way? I did not verification that this is my domain and I'm able to just make and delete all these records?
you have to first set the nameservers in namecheap before anything you're doing does anything
ooooh ok
havent got there yet
im not seeing any ddns on cloudflare - does it dynamically update if my ISP changes my WAN IP?
Cloudflare Docs
Dynamically update DNS records | Cloudflare DNS docs
Most Internet service providers and some hosting providers dynamically update their customer’s IP addresses. If this situation applies to you, you need an automated solution to dynamically update your DNS records in Cloudflare.
thank you
I've used dns o matic before, but it's kinda a pain
ill bookmark this in case ISP changes IP on me. If they don't for a long time tho i probably won't bother
you can also use a cname to just a ddns record from like no-ip
my dad's house has a "dynamic ip", but it hasn't changed for like the 6 years he's been a customer there
not sure what that means. cname is an alias, right?
it's just a record that points to another record
but they work across different domains
Alright I think I updated it all. Says it may take a while to process tho
I will say, when cloudflare imported the DNS records there was NOT a subdomain after _tcp so that was likely the issue
ok hmmm i do get the correct record from nslookup now but minecraft still being a baby about it
might need to run
ipconfig /flushdns
and maybe restart the gamedid both but still not working - what exactly does "getsockopt" mean?
someone else was complaining about that too
https://discord.com/channels/348681414260293634/1281371688969437244/1281371688969437244
but I can verify that the srv record is setup correctly
hmm. I have had it pop up before but usually in relation to trying to connect to the wrong port
thank you
also, I'd generally discourage having subdomain.example.com as an A record and _minecraft._tcp.subdomain.example.com as an srv record
try to name the A record something else
why is that? How do I get it to work otherwise?
I've seen minecraft sometimes try to join the A record on port 25565 instead of using the srv record
do I just delete all A records that aren't the "example.com" one?
if you don't need them, go for it
I thought I needed them for subdomain.example.com to resolve but I guess not as long as the SRV exists?
you still need an A record for the target
but it should just have a different subdomain than the srv record from my experience
but the target IS subdomain.example.com, no?
nah, target can be any A record
or cname, or even AAAA but ipv6 is a joke so don't do that
I am... a little confused
ipv6 :extreme_laugh:
"/64 subnet mask" - ravings of a derranged lunatic
anyways im a bit confused on what records I need to create
the target can be anything, it's just an a record that minecraft will join
but if I make my target the same as an A record I thought I wasn't supposed to do that
so _minecraft._tcp.subdomain.example.com port 12345 target backend.example.com
would be the same as typing
backend.example.com:12345
into the direct connection boxyes
if that makes sense
I will send you screenshot
OK so that has now been done but now the nslookup returns the wrong result
the svr hostname now shows example.com instead of subdomain.example.com
yeah, because example.com points to the correct IP
because example.com:12345 will join the server
ok
So if I'm getting the right result on nslookup does that mean minecraft should work now, or do i need to wait a while for the global dns servers to all update?
because minecraft still no work
so, because nslookup has
1.1.1.1
at the end, that means nslookup is using cloudflare's nameservers (see https://1.1.1.1)
but your ISP's nameservers may be slow to updateright so we expect those to update first
and windows caches domain records for a while
let me check without the 1.1.1.1
ok yea i got "non-existent domain"
wait
it doesnt work WITH 1.1.1.1 anymore either
wait now it does
what the heck
I'd just give it some time because you just recently put your domain on cloudflare
ok
I suppose I'll give it a rest for a while while I wait for nameservers to update. Thank you so much for your help!!!
:nod_FB:
cloudflare lists my domain as active now instead of nameserver pending, and the nslookups seem to resolve ok. Minecraft still telling me getsockopt tho
it works now! Thanks again! I'll close the ticket
post closed!
The post/thread has been closed!
Requested by treesone#0