LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 01-19-2008, 12:11 AM   #1
dpballey
Member
 
Registered: Feb 2004
Location: India
Distribution: Mandrake 9.1, Fedora 7, FreeBSD 6.2, , Slackware 12, Debian
Posts: 69

Rep: Reputation: 15
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
 
Old 01-19-2008, 04:22 AM   #2
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 3,888

Rep: Reputation: 774Reputation: 774Reputation: 774Reputation: 774Reputation: 774Reputation: 774Reputation: 774
Quote:
Originally Posted by dpballey View Post
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
This question might have been better in 'networking', however...

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?
 
Old 01-19-2008, 06:08 AM   #3
mpier
Member
 
Registered: Jan 2008
Location: Poland
Distribution: Slackware, Arch
Posts: 38

Rep: Reputation: 17
Hi all,
Quote:
Originally Posted by dpballey View Post
Hi,

Is it possible to implement static addresses on my lan with dnsmasq?
Yes it is. You can eg bind the IP to MAC address. Grep man dnsmasq for /etc/ethers or dhcp-host. If you have static arp you can use ethers file.

Sorry for my bad english...
 
Old 01-20-2008, 11:48 PM   #4
dpballey
Member
 
Registered: Feb 2004
Location: India
Distribution: Mandrake 9.1, Fedora 7, FreeBSD 6.2, , Slackware 12, Debian
Posts: 69

Original Poster
Rep: Reputation: 15
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
 
Old 02-27-2008, 09:29 AM   #5
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 230Reputation: 230Reputation: 230
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:
# Supply parameters for specified hosts using DHCP. There are lots
# of valid alternatives, so we will give examples of each. Note that
# IP addresses DO NOT have to be in the range given above, they just
# need to be on the same network. The order of the parameters in these
# do not matter, it's permissble to give name,adddress and MAC in any order
.

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.
 
Old 02-27-2008, 09:33 AM   #6
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 230Reputation: 230Reputation: 230
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:
# Supply parameters for specified hosts using DHCP. There are lots # of valid alternatives, so we will give examples of each. Note that # IP addresses DO NOT have to be in the range given above, they just # need to be on the same network. The order of the parameters in these # do not matter, it's permissble to give name,adddress and MAC in any order
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.

Last edited by archtoad6; 02-27-2008 at 10:56 AM. Reason: typo
 
Old 02-27-2008, 10:21 AM   #7
bgeddy
Senior Member
 
Registered: Sep 2006
Location: Liverpool - England
Distribution: slackware64 13.37 and -current, Dragonfly BSD
Posts: 1,810

Rep: Reputation: 227Reputation: 227Reputation: 227
- 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.
 
Old 02-28-2008, 07:47 AM   #8
dpballey
Member
 
Registered: Feb 2004
Location: India
Distribution: Mandrake 9.1, Fedora 7, FreeBSD 6.2, , Slackware 12, Debian
Posts: 69

Original Poster
Rep: Reputation: 15
Thanks for your valued inputs, Senior Members.

Quote:
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.
Agreed.

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.
Most important is assigning of default routes, nameservers,ntp servers, and thus I shall be able to control it centrally, as also advised by archtoad6.
Thanks friends for your inputs once again. The decision is in faour of dnsmasq.

Regards
 
Old 02-28-2008, 08:04 AM   #9
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 230Reputation: 230Reputation: 230
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.)
 
Old 02-29-2008, 03:24 AM   #10
dpballey
Member
 
Registered: Feb 2004
Location: India
Distribution: Mandrake 9.1, Fedora 7, FreeBSD 6.2, , Slackware 12, Debian
Posts: 69

Original Poster
Rep: Reputation: 15
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:
# Change this line if you want dns to get its upstream servers from
# somewhere other that /etc/resolv.conf
#resolv-file=

Si, i think I have to uncomment following lines in bold?
Code:
# By  default,  dnsmasq  will  send queries to any of the upstream
# servers it knows about and tries to favour servers to are  known
# to  be  up.  Uncommenting this forces dnsmasq to try each query
# with  each  server  strictly  in  the  order  they   appear   in
# /etc/resolv.conf
#strict-order
Regards
 
Old 02-29-2008, 12:11 PM   #11
bgeddy
Senior Member
 
Registered: Sep 2006
Location: Liverpool - England
Distribution: slackware64 13.37 and -current, Dragonfly BSD
Posts: 1,810

Rep: Reputation: 227Reputation: 227Reputation: 227
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.
 
Old 03-01-2008, 01:19 AM   #12
evilDagmar
Member
 
Registered: Mar 2005
Location: Right behind you.
Distribution: NBG, then randomed.
Posts: 480

Rep: Reputation: 31
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 {
  host dryad {
    hardware ethernet 00:12:8e:4b:2c:a3;
    fixed-address 10.1.1.2;
  }
}
 
Old 03-03-2008, 01:21 PM   #13
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 230Reputation: 230Reputation: 230
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&section=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 . . . :
  1. Static IP address -- Manually set at/on the host. (permanent)
  2. Fixed IP address -- Automatically set by the DHCP server to a value from a table, usually according to MAC address. (also permanent)
  3. Sticky IP address -- Automatically set by the DHCP server from a pool, BUT the server is configured so that it will never change under normal circumstances.
  4. Dynamic IP address -- Automatically set by the DHCP server from a pool, persistence depends on various configurable server options.
  5. Volatile IP address -- Automatically set by the DHCP server from a pool, AND the server deliberately changes it periodically.
Notes
  • #1 & #2 -- these are the ones we must agree to disagree about.
  • #3 & esp. #5 are not in common use.
    • #3 is the term my ISP uses to describe its policy of long term stability for its customers who don't buy a "true" static IP.
    • #5 is my attempt to describe the policy of my former ISP, Earthlink over Time-Warner, where my IP address changed in the early morning every March 1st & Oct. 1st unless I took deliberate action to keep it from happening.
  • #4 -- At least there is one term that we all seem to use the same way.
 
Old 03-05-2008, 12:54 AM   #14
evilDagmar
Member
 
Registered: Mar 2005
Location: Right behind you.
Distribution: NBG, then randomed.
Posts: 480

Rep: Reputation: 31
Quote:
Originally Posted by archtoad6 View Post
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.
So you can try to make up your own terminology if you like, but to the rest of the world it doesn't matter whether or not a machine has a static IP assignment configured in shell scripts or obtained through DHCP. The result is the same, either way. One mechanism (DHCP) is just much, much more manageable than the other.

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.
 
Old 03-05-2008, 06:43 AM   #15
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 230Reputation: 230Reputation: 230
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
dnsmasq question davepass Linux - Software 0 02-25-2006 04:01 PM
dnsmasq.conf exvor Linux - Software 2 06-24-2005 05:28 PM
running rc.dnsmasq davidsrsb Slackware 2 09-23-2004 10:12 PM
dnsmasq users? TheRealDeal Linux - Networking 6 04-29-2004 01:24 AM
Dnsmasq dunkyb Linux - Software 0 03-16-2003 02:25 PM


All times are GMT -5. The time now is 05:57 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration