SystemRage / py-kms

KMS Server Emulator written in Python
The Unlicense
2.04k stars 618 forks source link

Implement automagic KMS server discovery in pykms_Client #121

Closed dogtopus closed 1 year ago

dogtopus commented 3 years ago

Official KMS clients support auto discovery via DNS SRV record lookup with the domain name generated by appending DHCP option 15 (DNS suffix/search list) to _vlmcs._tcp. It would be nice to support this when there is no hostname specified (instead of accessing 0.0.0.0:1688 which doesn't work at all) as well as adding suffix override option for debugging.

bshep commented 3 years ago

I solved this by having my local DNS which is a pi.hole server have the following file: /etc/dnsmasq.d/02-kms.conf

with contents: srv-host=_vlmcs._tcp.local,kmsServer.local,1688,20

dogtopus commented 3 years ago

I solved this by having my local DNS which is a pi.hole server have the following file: /etc/dnsmasq.d/02-kms.conf

with contents: srv-host=_vlmcs._tcp.local,kmsServer.local,1688,20

What I want to achieve is to let pykms_Client resolve the SRV record and connect to the server to perform a activation simulation so one can use it to verify settings like you mentioned without need to fire up a Windows machine.

Currently it's possible to use dig and pass the IP to pykms_Client but that's an extra step.

xXcodgerXx commented 2 years ago

I solved this by having my local DNS which is a pi.hole server have the following file: /etc/dnsmasq.d/02-kms.conf

with contents: srv-host=_vlmcs._tcp.local,kmsServer.local,1688,20

I've tried with this branch and the new one. Any ideas what could be wrong? Details in link to new branch issue.

https://github.com/Py-KMS-Organization/py-kms/issues/45