Dynamic DNS update from .C# and .net
The setup process for smooth but I still needed a script to update the dynamic IP assigned to my connection with ZoneEdit. I wrote this script in C# and set it up to run every 1 min on the system. Hope you can find some use for it.
string Domain = "*.mydomain.com";
string URL = "http://dynamic.zoneedit.com/auth/dynamic.html?host=" + Domain + "&dnsto=" + IP.ToString();
HttpWebRequest HWR = (HttpWebRequest)HttpWebRequest.Create(URL);
HWR.Method = "GET";
SetBasicAuthHeader(HWR, "USERNAME", "PASSWORD");
StreamReader SR = new StreamReader(HWR.GetResponse().GetResponseStream());
string Response = SR.ReadToEnd();
SR.Close();
This is just the core snippet. There was more code around it but I have stripped it to keep it simple.
Replace
1) mydomain – with your domain name
2) USERNAME & PASSWORD – with your zoneedit username and password
Hope this helps you.
Related Posts
- Color Conversions
- Setting up IIS 7.5 and Apache on same server
- Color-based Blob Detection
- RAID 1 vs RAID 5
- Scripting form post in C# & .net
- Using HTTPWebRequest & HTTPWebResponse to automate web browsing
- Fiddling with Fiddler
- Draw graphs using OpenCV
- Tbot: The Self-Balancing Transformer Robot
- Do all versions of OpenCV run at the same speed?