LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 08-26-2011, 11:07 PM   #1
kumawat10
LQ Newbie
 
Registered: Aug 2011
Posts: 28

Rep: Reputation: Disabled
Smile DHCP Server


Hey all.. I want to change my dhcpd.conf file dynamically using C program.. The values of the parameters in the dhcpd.conf file will be provided by an application which will take inputs from the admin and accordingly, pass the values which I need to change in my dhcpd.conf file.. Please suggest some way to do it..

I thought of rewriting the .conf file each time when the values are given by the admin but will it be feasible??

Please anyone reply asap..

Thanks in advance...
 
Old 08-27-2011, 04:03 AM   #2
kumawat10
LQ Newbie
 
Registered: Aug 2011
Posts: 28

Original Poster
Rep: Reputation: Disabled
Lightbulb

Some one pls reply..
 
Old 08-27-2011, 08:35 PM   #3
scheidel21
Senior Member
 
Registered: Feb 2003
Location: CT
Distribution: Debian 6+, CentOS 5+
Posts: 1,323

Rep: Reputation: 100Reputation: 100
Look at file IO with text files.
 
0 members found this post helpful.
Old 08-29-2011, 12:39 AM   #4
kumawat10
LQ Newbie
 
Registered: Aug 2011
Posts: 28

Original Poster
Rep: Reputation: Disabled
may u pls elaborate??
 
Old 08-29-2011, 07:30 PM   #6
scheidel21
Senior Member
 
Registered: Feb 2003
Location: CT
Distribution: Debian 6+, CentOS 5+
Posts: 1,323

Rep: Reputation: 100Reputation: 100
As a tip to doing this, you have a couple of options, one is to do as you suggest re-writing the conf file each time. Alternatively if you know the keywords in the file that need to be edited for each admin entry then you could read the file and search for the keyword(s) then re-write just that line.
 
  


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
Baffling DNS from a DHCP server problem. Appears to be ignoring dhcp.conf royce2020 Linux - Networking 1 02-16-2010 12:40 PM
Problem on acquiring IP addr. on client from dhcp server through dhcp relay server haariseshu Linux - Server 5 08-10-2009 01:20 AM
Instead of Router DHCP Server, Pass DHCP Server control to Slackware orbit Slackware 6 05-11-2009 02:00 AM
How To know if a host configured with DHCP has obtained IP address from DHCP server? Prassanta SUSE / openSUSE 1 06-29-2006 09:48 AM
XP Pro Build 2600/sp1 v.1105 DHCP Client to Redhat 8.0 DHCP Server - Problems atomant Linux - Networking 5 06-28-2003 11:24 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:47 PM.

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