I have a free subdomain from afraid.org. They've given me a URL with a secret key. When that URL is requested afraid updates my records to point my subdomain at the IP the request came from. I don't have a static IP at my apartment, but I have a script that calls that URL whenever my IP changes, allowing me to always have a domain name pointed toward my home server.
I am not familiar with operating a DNS server. Would that accomplish the usecase I described above? I would like to set up the same system but with a domain I own and not the free one from afraid.org