MySQL and DNS Help Needed

Steve-0

Active Member
Joined
Apr 24, 2007
Messages
31
Reaction score
0
Location
Durban
Hi guys.

I am trying to setup a DYNDNS service alongside our Radius server, and am hoping that someone will be able to point me in the right direction.

Our Radius server authenticates our users and then stores the IP address given to that client in a MySQL DB. I am trying to find a way to automatically extract this information (IP Address) and insert it as an A record to a specific zone in our DNS.

The idea here is we will purchase (domainname).co.za and have about 40 or 50 A records pointing to our different clients from the information extracted from the MySql DB. When this IP changes, the DNS would be updated as follows:

client1.(domainname).co.za
client2.(domainname).co.za
client3.(domainname).co.za

Is there anyone able to help me with this? Any information would be greatly appreciated.

Thank you
 
Extra Information

Thanks for that info BobbyMac.

I had a brief look, and see that this is for Linux/Unix. I should have mentioned in my origional post that we are using Server 2003 as the MySQL host, and our DNS is run on a seperate Server 2003. The Radius is running on SUSE 10. I could setup DNS on the SUSE box, but would prefer, if possible to intergrate into our existing DNS as first prize. If this is not possible, then SUSE it is I guess.
 
Is you radius server issuing ips from its own DHCP or from a Server 2003 box?
 
Well, my understanding of how it works goes something like this:

The end user plugs in their router which connects and sends the username/password to SAIX (Our SP) who directs the authentication to us. At this point our Radius either accepts/denies ADSL access to the connecting IP based on this info. It is this IP (42.x.x.x) that I can see in the DB and want to extract and put into DNS on our server 2003.
 
Well, my understanding of how it works goes something like this:

The end user plugs in their router which connects and sends the username/password to SAIX (Our SP) who directs the authentication to us. At this point our Radius either accepts/denies ADSL access to the connecting IP based on this info. It is this IP (42.x.x.x) that I can see in the DB and want to extract and put into DNS on our server 2003.
OK, what I want to know is the Linux box or your 2003 Server issuing the Dynamic IPs? If your 2003 box is issuing IPs, then you don't need to worry about MySQL for your Dynamic IPs as, Server 2003's DNS can easily work in conjunction with the DHCP to automatically update IPs in the DNS ;) If not, then the only way I can see you doing it this way is by writing some sort of app or script that is triggered in MySql and updates your DDNS for you. Should be easy enough to do.
 
Well, neither as to my understanding the IP has already been assigned by SAIX before we authenticate their Username/Password. When they connect to our Radius (Running MySQL backend) to authenticate, the DB records the IP address the query is coming from, which is their Dynamic IP given by Telkom. This information is then stored if they authenticate with a valid Username/Password. So it is this DB entry that I want to put into DNS as a new A record depending on the username. If there is already an existing A record for that username (As in Yesterdays Dynamic IP) I need this to be over-written.

Am I making sense, or have a approached this the wrong way?
 
Well, neither as to my understanding the IP has already been assigned by SAIX before we authenticate their Username/Password. When they connect to our Radius (Running MySQL backend) to authenticate, the DB records the IP address the query is coming from, which is their Dynamic IP given by Telkom. This information is then stored if they authenticate with a valid Username/Password. So it is this DB entry that I want to put into DNS as a new A record depending on the username. If there is already an existing A record for that username (As in Yesterdays Dynamic IP) I need this to be over-written.

Am I making sense, or have a approached this the wrong way?
Ok, makes sense. So your radius server is purely an authenticating server and not actually assigning an IP Address to an authenticated client. So you want to do as follows:

SAIX (IP) -> radius -> mysql -> local DNS as Dynamic entry? If that's the case, then no, you will need to "manually" (either with the aid of a program or script that does this for you - or physically by hand and keyboard) update the Windows DNS Server. I don't know of any apps out there that does this, but I'm pretty sure you could find one.

In most cases you would actually assign an IP address for the connection, but as you're not, it creates your dilemma ;)

Just as an aside: Are you authenticating these clients so that they are joining your local network (like a VPN)?
 
Youve got it. Mmmmm. Now to find the app. I have a guy who could write something I guess, so it would now be a case of finding out which config files are changed by the DNS server when updates are made. Guess its google time.

On the aside bit: No VPN, I work for a small ISP, and got the DYNDNS idea when calling the bigger ISP's for a local DYNDNS providor. They mostly all do it in the way I have described (I assume), and not via a client loaded onto each users PC. Alot of our clients have local only and want DYNDNS.
 
Last edited:
Youve got it. Mmmmm. Now to find the app. I have a guy who could write something I guess, so it would now be a case of finding out which config files are changed by the DNS server when updates are made. Guess its google time.

On the aside bit: No VPN, I work for a small ISP, and got the DYNDNS idea when calling the bigger ISP's for a local DYNDNS providor. They mostly all do it in the way I have described (I assume), and not via a client loaded onto each users PC. Alot of our clients have local only and want DYNDNS.

Chances are good that they're using Bind name servers, which makes it a lot easier to do what you're wanting to do.
 
Hi guys.

Thanks for your help thus far, but I am afraid I have hit a dead end...

Well, I have been messing around with the config files on our NS1 server, and am having alot of problems with them. If I manually change the .dns file found in \Windows\System32\DNS for a specific domain, it doesnt update in DNS. I know I am modifying the correct file because if I make changes through DNS, the file is altered. Could this have anything to do with propergation across to our NS2?

The way I see it, if I modify the origional file, it should surely show up in DNS?

Any ideas?
 
I think your problem is that changing the files in system folders are not really permitted, especially when those files are already in use. The chances are you'd need to stop and restart the DNS service for the changes to take effect.

Side note: if you implemented MyDNS you'd have been done by now :D :D
 
Yip, I have no doubt I would be done by now, but unfortunately the powers that be want it to run on our existing server. The idea being that most of support guys can work with Windows, and only a few could fix something if there was a problem on the Linux box... I didnt think about restarting the services. Idiot... Will give that a try later on tonight, and let you know.
 
Top
Sign up to the MyBroadband newsletter
X