dnsmasq doubt/question
Hi,
This is Slackware 10 box. I am going to implement dnsmasq as dns/dhcp on my network. Is it possible to implement static addresses on my lan with dnsmasq? If not, I will have to burn my fingers with bind. Best Regards |
Quote:
If you use DHCP to hand out addresses in the well established manner, they won't be static. That is, the first box to ask for an IP will get the next IP in the list to be handed out, and it (AFAIK) doesn't matter which dhcp client/servers you use, that will be the case. However, there is a relatively simple cure. Don't use DHCP to hand out IP addresses. If you configure each client box to have a static IP it will never ask for an IP via DHCP, irrespective of which dhcp servers exist on the network. The admin in dealing with static adresses scales with the number of machines, so you might think this is a bad solution if you have several hundred of them, but my guess is that you have fewer. In practice you might choose a scheme like the following: Say everything is on the 192.168.1.x subnet. Allow your server and router to have 192.168.1 & .2. Start your static clients from, say, 192.168.1.10 up to 192.168.1.30 (depending on number of clients). You might then still allow the dhcp server to hand out addresses from 192.168.1.100 to .120 just in case you ever forget about the configuration and allow a machine using dhcp on to your network or maybe are using the network to supply the software to a machine for its first boot and config. This, of course, will have litle to do with how your network is seen from the outside world, but you didn't mean that, did you? |
Hi all,
Quote:
Sorry for my bad english... |
dns masq queries answered well
Hi,
Thanks Salasi Thanks Mpier Thanks for your valued inputs. Since Salasi's input seems simpler to my limited knowledge. Therefore, I shall be following his guide for implementing it as a quick solution. However, to increase / upgrade my knowledge I shall not forget to read the documentation described by Mpier. My network is a small network of 12 machines, Salasi. Thanks once again. Best Regards |
The trouble w/ true static IP addresses is that you must visit each box, normally physically, & set its IP address (from its console) using the tools provided by its OS. It's much easier to have your DHCP server assign fixed IP addresses based on the MAC addresses it sees. This is especially easy in dnsmasq. You can use either the /etc/dnsmasq.conf file, or the /etc/ethers file. Take mpier's excellent advice -- the man dnsmasq page is here. Also check out dnsmasq.conf.example & the /etc/ethers
man page. The format for the 2nd is almost trivial. The relevant section of the 1st begins: Quote:
On a personal note, I wouldn't even use static IP's on a 2-box LAN, let alone one w/ 12. W/ fixed IP's assigned through DHCP, you can "have your cake & eat it too" -- permanent addresses & central administration. |
The trouble w/ true static IP addresses is that you must visit each box, normally physically, & set its IP address (from its console) using the tools provided by its OS. It's much easier to have your DHCP server assign fixed IP addresses based on the MAC addresses it sees. This is especially easy in dnsmasq. You can use either the /etc/dnsmasq.conf file, or the /etc/ethers file. Take mpier's excellent advice -- the dnsmasq man page is here.
Also check out dnsmasq.conf.example & the /etc/ethers man page. The format for the 2nd is almost trivial. The relevant section of the 1st begins: Quote:
|
- and then there's the hassle of setting up default routes,netmasks, name servers, broadcast addresses, ntp servers etc that can all be handed out with DHCP.
Dnsmasq is definitely the way to go in my opinion. Centralize all your IP data for easy maintenance. As stated, a "pseudo" static IP setup can be had matching mac addresses to IP's or hostnames to IP's within dnsmasq.conf so a machine always gets the same IP via DHCP. I have four or five boxes on my network and find that to be too many to administer individually - (I would say twelve boxes is definitely a case for DHCP). Just let dnsmasq do all the work. |
Thanks for your valued inputs, Senior Members.
Quote:
Quote:
Thanks friends for your inputs once again. The decision is in faour of dnsmasq. Regards |
Cool!
Thanks for listening, i.e. taking our advice. -- There is nothing a busy body likes better than to have their advice taken. ;) Seriously, if you need any help w/ dnsmasq, be sure to post back here. (We're already subscribed & will be sure to see your post.) |
Thanks for holding my hand.
Today I tried dnsmasq. It did not assign nameservers to the client machine though it did assign IP, Netmask and Gateway. Supposedly, dnsmasq should take the nameservers from /etc/resolv.conf (as given in /etc/dnsmasq.conf) file where I have the dns nameservers entered. Please look at following quote. Here, since I am not assigning any other resolv-file, should dnsmasq not assign the nameservers from /etc/resolv.conf? Quote:
Si, i think I have to uncomment following lines in bold? Code:
# By default, dnsmasq will send queries to any of the upstream |
Dnsmasq, on my setup at least, issues the IP of the machine I am running dnsmasq on as the nameserver to clients.
This writes to /etc/resolv.conf on the client machines pointing them to my local machine as dnsmasq acts as a caching dns server. The client machines look to my local machine (gateway) for dns requests - again this is the machine running dnsmasq. The clients have "USE_DHCP='yes'" set in their /etc/rc.inet1.conf and "DHCP_KEEPRESOLV" not set (the default) for the relevant interface. Is /etc/resolv.conf being written on your clients and if so what is being written ? NB I have not had to make any changes to the lines you quote to get this to work. I believe those lines are to control how dnsmasq performs its lookups and not the IP it hands out via DHCP as this is its own address. So - in a nutshell - dnsmasq is acting as the dns server for the network and forwarding requests (when necessary) to upstream servers - caching them as it goes. |
Correction...
Static addresses can be defined just fine in every DHCP server I've ever seen (with one really rinky-dink exception). Just because a host uses DHCP to get it's IP address does not necessarily mean it's IP is dynamic. Even with ISC's dhcpd (which apparently everyone seems allergic to because it requires fifteen minutes of reading a man page) setting a static lease amounts to this much being added to the DHCP server's configuration: Code:
group { |
Terminology Quibble
Yes, I know I may be nit-picking; but I object to calling any dynamically assigned IP "static" -- my dictionary says "static" & "dynamic" are opposites. That makes "dynamically assigned static IP addresses" a real oxymoron. However permanent they are intended to be, I much prefer the term "fixed" for such IP's.
The authorities I tried to consult at best are silent or disagree w/ each other & at worst contradict themselves: http://www.google.com/search?q=site%...+ip+address%22 http://www.google.com/search?q=site%...+ip+address%22 http://www.google.com/linux?q=%22fixed+ip+addresses%22 http://www.google.com/linux?q=%22static+ip+addresses%22 http://en.wikipedia.org/wiki/Dhcp#Applicability http://en.wikipedia.org/wiki/Dhcp#Ba...ocol_Operation http://en.wikipedia.org/wiki/Dhcp#IP_address_allocation http://en.wikipedia.org/wiki/IP_addr...c_IP_addresses http://man.linuxquestions.org/index....pe=2§ion=8 Absent a consensus which I can point to here, all I can do is list the terms I prefer & hope that my preferences come from learning from authoritative sources, rather than . . . :
|
Quote:
As to item #5, such things are not only contrary to the spirit of DHCP, but have been cautioned against many, many times because they result in, among other things, broken downloads and a lot of calls to tech support (Win98 used to be much less than reliable about taking on a new IP address). When in doubt, just read the RFCs. |
Which RFC's? I'd like to see the authoritative sources for the terminology. I spent at least one fruitless hour searching before my last post.
|
All times are GMT -5. The time now is 10:12 AM. |