Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any SRV record examples or test cases? #57

Closed
Elycin opened this issue Dec 24, 2020 · 3 comments
Closed

Any SRV record examples or test cases? #57

Elycin opened this issue Dec 24, 2020 · 3 comments

Comments

@Elycin
Copy link

Elycin commented Dec 24, 2020

Detailed description

This is rather a feature request/enhancement on elaborative explanation.
I spent today working with this library and reading through the code, however, I could not find any examples or test cases of mechanisms that explain how RecordType::SRV would work.

I'm not sure if I should be putting the weight, port, and target in the content parameter, or if there's specific keys that I should use?

Here's some example mock code I wrote.

        $dnsPayload = [
            'name' => $request->input('name'),
            'type' => self::TYPE_RESOLVER[$request->input('type')],
            'content' => sprintf("%d %d _%s._%s.%s", $request->input("weight"), $request->input("port"), $request->input("service"), $request->input("protocol"), $request->input("name")),
            'ttl' => $request->input('ttl'),
            // What about priority, protocol, weight?
        ];

Context

I'm currently working on a system that will issue subdomains to people who want them on various domains that I own,

How can it benefit other users?

I've previously worked in the game server hosting industry, where hundreds of thousands of clients create subdomains to easily access their server rather than remembering an IP address. Having a proper way to do this could likely sway some big names in this particular industry rather than leaving Cloudflare as the only viable DNS management option via a CURL request.

eg: In the case of Minecraft, _minecraft._tcp

Your environment

I don't think is exactly relevant for this request, but...

OS: Windows 10
PHP 7.4.10 (cli) (built: Sep  1 2020 16:52:39) ( ZTS Visual C++ 2017 x64 )
Laravel 8.0
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies

Thanks in advance.

@robbinjanssen
Copy link
Member

robbinjanssen commented Dec 29, 2020

Hi @Elycin,

Sorry for the late response.

Your code looks fine, but your content is missing priority which should be added at the beginning.

Something like: 0 100 8765 _minecraft._tcp.your_domain.com. where:
0 = priority,
100 = weight
8765 = port

Also see https://doc.powerdns.com/authoritative/appendices/types.html#srv

Let me know if that works for you :-)

@Elycin
Copy link
Author

Elycin commented Dec 29, 2020 via email

@robbinjanssen
Copy link
Member

Perfect!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants