LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 10-15-2011, 05:40 PM   #1
NS-ME
LQ Newbie
 
Registered: Oct 2011
Posts: 2

Rep: Reputation: Disabled
Question How to create a code that reads and writes my IP into a zone file


Hi

I'm using CentOS 6, Apache, and BIND DNS.

BIND doesn't allow me to assign a CNAME record to a root-name (@ CNAME abc.abc.com), only an A record, but I have a dynamic IP address.

I think about creating a code that detects my external IP address every 60 minutes for example, and if the IP changed - update the zone file (example.com.zone).

A better explanation:

IP1 is inside the zone file: @ A IP1;
I restart my router, my IP changes.
The code runs, detects the new IP (IP2), writes it to the zone file
IP2 is inside the zone file: @ A IP2;

Do you know if it's possible? can I do it with PHP or PERL? I'm new with Linux, and I'm not sure it's even connected to Linux. Oh and don't worry: My domain is ALWAYS pointing to the right DNS server: I'm using DynDNS for that.

I'm not sure it's in the right forum or even the right website but any answer will be good!

Thanks

sorry if my English is bad...

Last edited by NS-ME; 10-15-2011 at 05:48 PM.
 
Old 10-16-2011, 04:50 PM   #2
harry edwards
Member
 
Registered: Nov 2007
Location: Lincolnshire, UK
Distribution: CentOS, Fedora, and Suse
Posts: 365

Rep: Reputation: 48
This thread could help http://ubuntuforums.org/archive/index.php/t-526176.html
 
Old 10-17-2011, 01:35 PM   #3
lithos
Senior Member
 
Registered: Jan 2010
Location: SI : 45.9531, 15.4894
Distribution: CentOS, OpenNA/Trustix, testing desktop openSuse 12.1 /Cinnamon/KDE4.8
Posts: 1,144

Rep: Reputation: 217Reputation: 217Reputation: 217
You could have an A record of your abc.com e.g. yoursite.abc.com
with
Code:
yoursite.abc.com.    IN A   yoursite.dyndns.org.     <--- watch out for . otherwise you break your Zone)
 
Old 10-17-2011, 03:06 PM   #4
NS-ME
LQ Newbie
 
Registered: Oct 2011
Posts: 2

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by lithos View Post
You could have an A record of your abc.com e.g. yoursite.abc.com
with
Code:
yoursite.abc.com.    IN A   yoursite.dyndns.org.     <--- watch out for . otherwise you break your Zone)
Do you mean, use host.dyndns.org. as an "IP address", with the 3 dots? If yes, is it working with @ too? for example, I know now that

www.mysite.com IN A host.dyndns.org. >>is working, but does
@ IN A host.dyndns.org. >>work too?

EDIT:: It's not working. Can you exlain yourself?

Last edited by NS-ME; 10-18-2011 at 03:58 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Java File reads and writes manolakis Programming 2 04-08-2009 12:52 PM
LXer: Use auditing to track reads and writes in a file LXer Syndicated Linux News 0 08-12-2007 10:30 AM
LXer: Use auditing to track reads and writes in a file LXer Syndicated Linux News 0 08-12-2007 01:02 AM
CD R/RW: reads or writes but not both hatha Linux - General 6 04-17-2005 07:12 PM
cdburner reads not writes NGraphiX Linux - Hardware 1 02-28-2003 04:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:03 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration