Dynamic DNS

It's impractical to run your own DNS servers if your IP address is dynamic changes. Even if you wanted to pay for a static address, you're probably better off taking advantage of someone else's infrastructure if you can. Many top tier hosting companies are giving away DNS services for free anyway, so pick a provider and install a client.

The Service Provider

As with many things, there are two parts; the Service Provider and the Client. Here's a good list of them. I've used editDNS and subsequently ZoneEdit and also NameCheap, the latter being now free.

http://www.gnutomorrow.com/best-free-dynamic-dns-services-in-2013/

The Client

For Ubuntu, the most used client for ddns seems to be ddclient. The instructions are athttp://help.ubuntu.com/community/DynamicDNS or, after installing you can enter ddclient -help for the most up-to-date info on the client

Advanced Client Useage

An advanced use case is one where you have multiple address to maintain, such as when combining openvpn and dyndns. Below is a an example configuration that accomplishes this by retrieving the external IP using a web service, and the internal IP from the local eth0.