How often will my Comcast IP address change?

If you don't purchase a static IP from your ISP, your ISP has no obligation to keep permanent the one it leases to you via DHCP. So you should always treat your IP changing as a possibility regardless of what you or others have observed. Your IP changing is normal if you do not have a static IP from your ISP.

There are "dynamic DNS" services - Dyn (formerly Dyndns) and No-IP being two of them - that will let you create an account, obtain a DNS hostname, and then run an "update client" somewhere on your internal network. The update client will periodically check your external IP and report changes to the service. So then this DNS will resolve to your public IP.

Dyn used to be free, No-IP still is AFAIK (this may have changed).

You'll still need to make sure NAT is set up correctly if you want external requests to reach a specific system inside your network. You also cannot use this DNS to reach hosts from inside to inside your network unless you run your own DNS server and resolve LAN-local names yourself.


Well this is responding to a very old post but.. I've been collecting Comcast DCHP renewal data for the past 3 years and here are the results:

  • Comcast has issued 3 IP addresses via DHCP over the last 3 years
  • The longest period I've held the same IP is 850 days
  • The shortest is 28 days
  • I've currently had the same IP for the last 193 days

  1. No you can't prevent Comcast from changing your IP address unless you've purchased a Static IP address from them.
  2. When you change your router/MAC they will likely issue a new IP address.
  3. In my experience Comcast changes IP addresses every 1 to 3 years

One way to keep your "dynamic IP" in sync with your DNS is by using a service like Dyn or NoIP which provide their proprietary Domain names/Domain names to purchase.

However if you have your own custom domain name that you'd like to use, you can use the DNS services from NameSilo (http://www.namesilo.com) as your DNS provider and the powershell windows script below along with a scheduled task to replicate the Dyn/NoIP service.

Assuming you're running windows, here's a simple script that you can "schedule" using Task Scheduler to run on StartUp/Logon and then rerun every 6 hours (that way the maximum downtime due to an IP address change is 6 hours).

Save the script below in a file called NameSiloDDNS.ps1

# NameSilo API Dynamic DNS
#Variables
param([string]$APIkey=$(throw "APIKey is required"), [string]$domain=$(throw "Domain is required"), [string]$record)


###Code - Do not edit below this line
# Gather data about the DNS entries in the domain
$listdomains = Invoke-RestMethod -Uri "https://www.namesilo.com/apibatch/dnsListRecords?version=1&type=xml&key=$APIkey&domain=$domain"
$CurrentIP = $listdomains.namesilo.request.ip
if ($record) {
    $RecordIP = ($listdomains.namesilo.reply.resource_record|where {$_.host -eq "$record.$domain" -and $_.type -eq "A"}).value
    $RecordID = ($listdomains.namesilo.reply.resource_record|where {$_.host -eq "$record.$domain" -and $_.type -eq "A"}).record_id
} else {
    $RecordIP = ($listdomains.namesilo.reply.resource_record|where {$_.host -eq "$domain" -and $_.type -eq "A"}).value
    $RecordID = ($listdomains.namesilo.reply.resource_record|where {$_.host -eq "$domain" -and $_.type -eq "A"}).record_id
}
$listdomains.namesilo.reply
#Write-Host "CurrentIP $CurrentIP, RecordIP $RecordIP, RecordID $RecordID"

# If the current IP address is not the same as the one in the record it updates it
Write-Host "https://www.namesilo.com/apibatch/dnsUpdateRecord?version=1&type=xml&key=$APIkey&domain=$domain&rrid=$RecordID&rrhost=$record&rrvalue=$CurrentIP&rrttl=3600"
if ($CurrentIP -ne $RecordIP){
    if ($record) {
        Write-Host "Updating $record.$domain with IP $CurrentIP"
    } else {
        Write-Host "Updating $domain with IP $CurrentIP"
    }
    $update = Invoke-RestMethod -Uri "https://www.namesilo.com/apibatch/dnsUpdateRecord?version=1&type=xml&key=$APIkey&domain=$domain&rrid=$RecordID&rrhost=$record&rrvalue=$CurrentIP&rrttl=3600"
    $update.namesilo.reply
} else {
    Write-Host "No need to update $record.$domain, IP $CurrentIP upto date"
}

Next save the script below in a file called UpdateDDNSIPv4.bat.

PowerShell -ExecutionPolicy Bypass .\NameSiloDDNS.ps1 <NameSilo_API_Key> somedomain.com
PowerShell -ExecutionPolicy Bypass .\NameSiloDDNS.ps1 <NameSilo_API_Key> somedomain.com subdomain

Keep both the files in the same directory. UpdateDDNSIPv4.bat is the batchfile which should be called by Task Scheduler in your recurring task.

Couple of things to note, you will need to Login to your NameSilo account and under API Manager -> Generate an API Key which you need to enter in the batch script above to replace <NameSilo_API_Key>. This script can be used to update your A DNS records for the main domain (e.g. somedomain.com) and also for your subdomains (e.g. subdomain). You can create one line for each domain/subdomain you want to update.

This script will automatically find your "Public IP Address" and then update your NameSilo DNS A records.

You can find a BASH equivalent of this script here: https://github.com/pztop/namesilo_ddns

A Python equivalent of a script can also be found at: https://github.com/rbenji/DynamicDNS-for-NameSilo

This script was taken and customized from http://www.forkrobotics.com/2014/10/dynamic-dns-with-namesilo-and-powershell/

Hope this helps

Tags:

Ip

Networking