How often will my Comcast IP address change?

6

2

I had a Linux/Apache server in my house, a domain name hosted by 1and1 which points to my Comcast public IP (testing only, I know I am not allowed to host a site), and a D-Link router which forwards port 80 to the Linux server. Everything was working perfect.

I then bought a new Linksys router, and things stopped working.

Upon troubleshooting, I found that my home IP no longer matched the IP set in 1and1. Furthermore, the IP set in 1and1 is located hundreds of miles away.

Is this normal? How often will the IP change? Is there anything I can do to prevent?

user1032531

Posted 2013-10-21T16:36:17.267

Reputation: 1 331

I have comcast as my isp. my external ip has not changed in over 10 years. No, it's not a paid static IP. – Blekthor – 2017-01-08T20:12:19.393

Mine hasn't changed since writing this post 4 years ago. – user1032531 – 2017-06-10T20:37:52.363

3The honest answer to this question is pretty much "As often as Comcast wants it to change." but at least once a week. Your purchase of the new router likely has nothing to do with your ip changing to be honest. There are limited number of IPv4 addresses Comcaster is the owner an will assign it to any number of their customers. You can purchase a static ip address if you want of course. – Ramhound – 2013-10-21T16:41:15.437

@Ramhound. Thanks. I've had the same dynamic IP for over a year. I've read that Comcast and others will keep them if the mac address is the same, so the router change might have had an effect. – user1032531 – 2013-10-21T16:48:21.837

@user1032531, you're right that MAC address changes will probably get you a new IP, but you can expect occasional changes even if the MAC doesn't change. I have a similar setup, but my DNS provider (namecheap) includes the ability to dynamically update the IP. – heavyd – 2013-10-21T17:11:31.023

Answers

7

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.

LawrenceC

Posted 2013-10-21T16:36:17.267

Reputation: 63 487

2I've had the same IP address from comcast for about 10 years now, spanning multiple addresses... until today. They suddenly decided to change it. :-( – billynoah – 2015-03-13T23:42:07.817

1

I suggest using http://freedns.afraid.org/ for dynamic DNS hosting.

– Cristian Ciupitu – 2013-10-21T20:02:40.440

5

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

null pointer

Posted 2013-10-21T16:36:17.267

Reputation: 51

2

  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

rboy

Posted 2013-10-21T16:36:17.267

Reputation: 310

0

I have Time Warner cable, which is probably pretty similar to your Comcast. I'm also running a public web server on my Raspberry Pi, with my domain name pointed to my public IP address. My IP address changes probably less than once per year. The few times it does, I just log into my register.com account and re-point the A record. I very seldom need to actually do that. In the past 5 years it's probably been about 3 times, and at least one of those was because I got a new cable modem. Yes, this is also anecdotal. However, I think there's enough anecdotal evidence out there to suggest that a public IP address from a cable internet provider is not likely to change very often.

Charles Burge

Posted 2013-10-21T16:36:17.267

Reputation: 1 792