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
Admincraft Meta
Admincraft Meta5mo ago
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
SilentBot
SilentBot5mo ago
Just to sanity check, this is java edition right?
TreesOne
TreesOneOP5mo ago
yes
SilentBot
SilentBot5mo ago
What domain registrar are you using?
TreesOne
TreesOneOP5mo ago
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"
Snow Kit
Snow Kit5mo ago
does it work if they just put in the IP and port?
TreesOne
TreesOneOP5mo ago
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)
Snow Kit
Snow Kit5mo ago
can you dm me the srv that they're typing into minecraft so I can check if it's setup correctly
TreesOne
TreesOneOP5mo ago
ye
Snow Kit
Snow Kit5mo ago
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
Server: one.one.one.one
Address: 1.1.1.1

Non-authoritative answer:
_minecraft._tcp.subdomain.example.com SRV service location:
priority = 1
weight = 1
port = 6969
svr hostname = subdomain.example.com
Server: one.one.one.one
Address: 1.1.1.1

Non-authoritative answer:
_minecraft._tcp.subdomain.example.com SRV service location:
priority = 1
weight = 1
port = 6969
svr hostname = subdomain.example.com
as the result I did that lookup on your domain and the record does indeed appear to be invalid
TreesOne
TreesOneOP5mo ago
alright so what do I need to do?
Snow Kit
Snow Kit5mo ago
you said the protocol is _tcp.subdomain, is there no "name" field or something
TreesOne
TreesOneOP5mo ago
No. I'll dm u what the UI looks like Potentailly of note, if I run
nslookup -type=srv _minecraft._tcp.example.com 1.1.1.1
nslookup -type=srv _minecraft._tcp.example.com 1.1.1.1
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
SilentBot
SilentBot5mo ago
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
TreesOne
TreesOneOP5mo ago
hmmm
Snow Kit
Snow Kit5mo ago
namecheap's article does appear to imply that you should be able to see the subdomain inside of the protocol part of the field
No description
TreesOne
TreesOneOP5mo ago
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?
Snow Kit
Snow Kit5mo ago
I will say, I've never had any issues with cloudflare's DNS. It's completely free to use and really easy to setup
TreesOne
TreesOneOP5mo ago
they give free domains?
Snow Kit
Snow Kit5mo ago
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
TreesOne
TreesOneOP5mo ago
so what would that mean for me - it makes it a place where i can create the records?
Snow Kit
Snow Kit5mo ago
yeah
TreesOne
TreesOneOP5mo ago
do i need to do some domain transfer or something?
Snow Kit
Snow Kit5mo ago
nah, you just change the nameservers, cloudflare will tell you how to do it
TreesOne
TreesOneOP5mo ago
just a moment ill try it out
Snow Kit
Snow Kit5mo ago
if you do end up using cloudflare though, make sure to disable the cloudflare proxy on minecraft related subdomains
TreesOne
TreesOneOP5mo ago
What does that mean?
Snow Kit
Snow Kit5mo ago
they have anti ddos stuff, but it doesn't matter for minecraft and isn't compadible
TreesOne
TreesOneOP5mo ago
understood so is the hope that by switching to cloudflare ill be able to enter the SRV record without bugs?
Snow Kit
Snow Kit5mo ago
they just give you one big field to type the entire srv record into now
No description
TreesOne
TreesOneOP5mo ago
can you dm me the format that needs to go in?
Snow Kit
Snow Kit5mo ago
I mean you can see that right there the blurred part is just example.com
TreesOne
TreesOneOP5mo ago
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?
Snow Kit
Snow Kit5mo ago
you have to first set the nameservers in namecheap before anything you're doing does anything
TreesOne
TreesOneOP5mo ago
ooooh ok havent got there yet im not seeing any ddns on cloudflare - does it dynamically update if my ISP changes my WAN IP?
Snow Kit
Snow Kit5mo ago
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.
TreesOne
TreesOneOP5mo ago
thank you
Snow Kit
Snow Kit5mo ago
I've used dns o matic before, but it's kinda a pain
TreesOne
TreesOneOP5mo ago
ill bookmark this in case ISP changes IP on me. If they don't for a long time tho i probably won't bother
Snow Kit
Snow Kit5mo ago
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
TreesOne
TreesOneOP5mo ago
not sure what that means. cname is an alias, right?
Snow Kit
Snow Kit5mo ago
it's just a record that points to another record but they work across different domains
TreesOne
TreesOneOP5mo ago
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
Snow Kit
Snow Kit5mo ago
might need to run ipconfig /flushdns and maybe restart the game
TreesOne
TreesOneOP5mo ago
did both but still not working - what exactly does "getsockopt" mean?
TreesOne
TreesOneOP5mo ago
No description
Snow Kit
Snow Kit5mo ago
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
TreesOne
TreesOneOP5mo ago
hmm. I have had it pop up before but usually in relation to trying to connect to the wrong port thank you
Snow Kit
Snow Kit5mo ago
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
TreesOne
TreesOneOP5mo ago
why is that? How do I get it to work otherwise?
Snow Kit
Snow Kit5mo ago
I've seen minecraft sometimes try to join the A record on port 25565 instead of using the srv record
TreesOne
TreesOneOP5mo ago
do I just delete all A records that aren't the "example.com" one?
Snow Kit
Snow Kit5mo ago
if you don't need them, go for it
TreesOne
TreesOneOP5mo ago
I thought I needed them for subdomain.example.com to resolve but I guess not as long as the SRV exists?
Snow Kit
Snow Kit5mo ago
you still need an A record for the target but it should just have a different subdomain than the srv record from my experience
TreesOne
TreesOneOP5mo ago
but the target IS subdomain.example.com, no?
Snow Kit
Snow Kit5mo ago
nah, target can be any A record or cname, or even AAAA but ipv6 is a joke so don't do that
TreesOne
TreesOneOP5mo ago
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
Snow Kit
Snow Kit5mo ago
the target can be anything, it's just an a record that minecraft will join
TreesOne
TreesOneOP5mo ago
but if I make my target the same as an A record I thought I wasn't supposed to do that
Snow Kit
Snow Kit5mo ago
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 box
TreesOne
TreesOneOP5mo ago
yes
Snow Kit
Snow Kit5mo ago
if that makes sense
TreesOne
TreesOneOP5mo ago
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
Snow Kit
Snow Kit5mo ago
yeah, because example.com points to the correct IP because example.com:12345 will join the server
TreesOne
TreesOneOP5mo ago
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
Snow Kit
Snow Kit5mo ago
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 update
TreesOne
TreesOneOP5mo ago
right so we expect those to update first
Snow Kit
Snow Kit5mo ago
and windows caches domain records for a while
TreesOne
TreesOneOP5mo ago
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
Snow Kit
Snow Kit5mo ago
I'd just give it some time because you just recently put your domain on cloudflare
TreesOne
TreesOneOP5mo ago
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!!!
Snow Kit
Snow Kit5mo ago
:nod_FB:
TreesOne
TreesOneOP5mo ago
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
Admincraft Meta
Admincraft Meta5mo ago
post closed!
The post/thread has been closed!
Requested by treesone#0

Did you find this page helpful?