pfSense, Cloudflare and Dynamic DNS

I’ve finally solved a problem I was having with getting cloudflare to update my IP address.

I’m using OpenVPN, and just on a home cable connection – the IP changes periodically (frequently enough to be annoying).

Steps are as follows (high level):

  1. Register your domain name with Cloudflare (follow their instructions)
  2. Create an A record (I used “vpn”)
  3. Get your API key
  4. Log into your pfSense box and go to “Services / Dynamic DNS / Dynamic DNS Clients”
  5. Add a new client with the following settings:
    1. Service type – Cloudflare (dropdown)
    2. interface to monitor – WAN
    3. hostname – “vpn” (or whatever you set your A record to) in the first box, with your domain (e.g. “example.com”) in the second.
    4. Username is your cloudflare username, so likely your email address
    5. password = API key
  6. The click “Save & force update”

Check the DNS settings in cloudflare – it should the record updated. If you’re having issues, check the “verbose logging” box in pfSense page I just talked about, and then look at the logs in “Status / System / General”

If you’re using this with openVPN, I had had to use a custom hostname when I exported the client. All that has to be is “vpn.example.com” (or whatever you chose). You can test this with a simple nslookup.

 

Leave a comment