LinuxQuestions.org
Review your favorite Linux distribution.
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 02-16-2012, 05:34 AM   #1
leamassiot
Member
 
Registered: Dec 2005
Location: France
Distribution: Debian
Posts: 123

Rep: Reputation: 17
Question BIND configuration & Computers with several network interfaces


Hello,

Thank you for reading my post.
My question is about how to configure a DNS server in case some computers (on the LAN where the server in implanted) have several network interfaces.

Situation in detail :
1) DEBIAN SERVER (S): runs a BIND and a DHCP servers.
2) LAN: some computers have several network interfaces.
3) A computer (C) has:
- an Ethernet network interface (i1),
- a wireless network interface (i2).
(i1) has a static IP attached: w.x.y.z1
(i2) gets its IP via DHCP: w.x.y.z2
4) BIND SERVER: manages the zone files "db.my.zone" and "db.w.x.y".

My question is the following:
How do I have to configure the BIND server to take this situation into account?

The idea behind my head:
A standard record in "db.my.zone" is for instance:
Code:
w.x.y.z1    A    (C)
Is there any way to translate something like: such IP is associated with such hostname and such network interface?
Code:
w.x.y.z1  (C)   (i1)
w.x.y.z2  (C)   (i2)
I am aware of the fact it may not be what a DNS server is suppose to offer as a service...
Is it possible at all?
What can you advise me to do?

Thank you and best regards,
--
Léa
 
Old 02-16-2012, 05:43 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
Well I'd say there's no such service as I don't see that there is a described service there in the first place. I would mainly advise against putting clients in DNS in the first place, it seems kind of pointless and a lot of hassle. But even outside of that, if they are not being populated by DHCP server updates, then what's to do? You just put in the variants of the hostname pc-wifi or pc-wired etc... against each IP. What bit is missing? In terms of DNS there's nowhere for this extra information you seem to be after other than in the hostname. Well, there are TXT records and the likes, but you'll surely not need that sort of stuff.
 
Old 02-16-2012, 12:51 PM   #3
leamassiot
Member
 
Registered: Dec 2005
Location: France
Distribution: Debian
Posts: 123

Original Poster
Rep: Reputation: 17
Hello acid_kewpie,
Thank you for your answer.

Quote:
I would mainly advise against putting clients in DNS in the first place, it seems kind of pointless and a lot of hassle.
You're right. What if it's a small LAN (< 20 computers) with mainly computers with one single network interface and one static IP address?

Quote:
just put in the variants of the hostname pc-wifi or pc-wired etc...
Ok. I tested this:
Code:
1)  both (i1) and (i2) are deactivated ;
2)  I activate (i2) ;
3)  (i2) gets an IP via DHCP ;
4)  the DNS server forward zone file is updated with an A record: (C) A w.x.y.z2 ;
5)  the DNS server reverse zone file is updated with a PTR record: w.x.y.z2 PTR (C).zone.my. ;
6)  I activate (i1) (I plug in an Ethernet cable) ;
7)  I edit the forward zone file ;
8)  I add an A record: (C) A w.x.y.z1 ;
9)  I can ping both IPs.
Quote:
What bit is missing?
If both network interfaces (i1) and (i2) are configured to receive their IP address via DHCP, only one record gets added to the forward and reverse zone files.
If we activate first (i1) and then (i2),
(i1) gets an associated record which is added to the zone files
and then, if we activate the second interface (i2)
the record adding fails with the messages:
Code:
Updating zone 'zone.my/IN': update unsuccessful: (C).zone.my/TXT: 'RRset exists (value dependent)' prerequisite not satisfied (YXDOMAIN)
Updating zone 'zone.my/IN': update unsuccessful: (C).zone.my/TXT: 'RRset exists (value dependent)' prerequisite not satisfied (NXRRSET)
Forward map from (C).zone.my to w.x.y.z2 FAILED: Has an A record but no DHCID, not mine
Quote:
In terms of DNS there's nowhere for this extra information you seem to be after other than in the hostname.
Ok. That's what I thought.

Quote:
Well, there are TXT records and the likes, but you'll surely not need that sort of stuff.
Why mentioning it then (this question is meant to be nice )?

So, I guess only one interface receives paquets from the network in case there is no additional human action (e.g. adding records to the zone files "a la mano"), isn't it?
It's not an "issue" for a "classical" use... What if we want to load balance between two network interfaces on a same machine? Is it possible and how? What are the known techniques?

Thank you and best regards,
--
Léa

Last edited by leamassiot; 02-16-2012 at 12:56 PM. Reason: mentionning => mentioning
 
Old 02-16-2012, 03:45 PM   #4
devilboy09
Member
 
Registered: Nov 2011
Location: Iran
Distribution: Debian, CentOS, LFS, CloudLinux
Posts: 377

Rep: Reputation: 10
Code:
If both network interfaces (i1) and (i2) are configured to receive their IP address via DHCP, only one record gets added to the forward and reverse zone files.
 If we activate first (i1) and then (i2),
 (i1) gets an associated record which is added to the zone files
 and then, if we activate the second interface (i2)
 the record adding fails with the messages:
Code:
Updating zone 'zone.my/IN': update unsuccessful: (C).zone.my/TXT: 'RRset exists (value dependent)' prerequisite not satisfied (YXDOMAIN)
Updating zone 'zone.my/IN': update unsuccessful: (C).zone.my/TXT: 'RRset exists (value dependent)' prerequisite not satisfied (NXRRSET)
Forward map from (C).zone.my to w.x.y.z2 FAILED: Has an A record but no DHCID, not mine
of course it would fail.because you already have a entry in your zone database associated with the same hostname!!!
 
Old 02-17-2012, 05:18 AM   #5
leamassiot
Member
 
Registered: Dec 2005
Location: France
Distribution: Debian
Posts: 123

Original Poster
Rep: Reputation: 17
Quote:
of course it would fail.because you already have a entry in your zone database associated with the same hostname!!!
It's not that obvious.
As I wrote earlier, if you add yourself two A records like the two below in a forward zone file, the server doesn't fail when you start it and you can successfully ping the two IP addresses afterwards:
Code:
(C)   A   w.x.y.z1
(C)   A   w.x.y.z2
 
Old 02-17-2012, 05:34 AM   #6
devilboy09
Member
 
Registered: Nov 2011
Location: Iran
Distribution: Debian, CentOS, LFS, CloudLinux
Posts: 377

Rep: Reputation: 10
you said in post #3 you're getting an error about updating the zone database.and when i see you error i realize that you configure ddns.
here's the problem.your first ethernet card updates its record with a unique hostname that's your machine name.and after that when your second ethernet card wants to update its record, named service realized that there's another entry in zone database with its hostname, but different ip address.so it updates the record with new ip address.that's why you have only one entry in zone database.
 
Old 02-17-2012, 07:13 AM   #7
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748
Blog Entries: 11

Rep: Reputation: 233Reputation: 233Reputation: 233
If you manualy add the two A records for the host that gets two different ip adresses you configure something similar to round robin. Also the IP's point to the same server does not mean anything.

So your problem resides within ddns. I would dig on the part of the message with 'does not have a DHCID. not mine'. So in contrast to what devil says first come, first mark the second entry is ignored. Or see if you can configure the server to just 'do it' and not consider any existing records.

As far as I remember you can also pass an identifier as the dhcp client. Maybe you can configure your server to do something depending on it.
 
Old 02-17-2012, 08:25 AM   #8
leamassiot
Member
 
Registered: Dec 2005
Location: France
Distribution: Debian
Posts: 123

Original Poster
Rep: Reputation: 17
@devilboy09
Quote:
so it updates the record with new ip address.
No, it doesn't : if we do not deactivate first the first network interface, it fails like I described in post #3.

Quote:
that's why you have only one entry in zone database.
But, yes: if we do deactivate the first network interface, the corresponding DNS record is updated with the new IP address after the lease time of the first DNS record has expired. Meantime, the machine is not pingable anymore.

@zhjim
Quote:
So in contrast to what devil says first come, first mark the second entry is ignored.
I'm not sure that I understand what you've written here
The second entry is not ignored.
If I ping (C), sometimes it responds with w.x.y.z1 and sometimes with w.x.y.z2...

Quote:
As far as I remember you can also pass an identifier as the dhcp client. Maybe you can configure your server to do something depending on it.
Yes... maybe (I had a look at the man page: http://linux.die.net/man/5/dhclient.conf
- section interface "name" { declarations ... })... I don't obviously see how. But that's an interesting remark.

Thanks! Best regards.
 
Old 02-17-2012, 08:53 AM   #9
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748
Blog Entries: 11

Rep: Reputation: 233Reputation: 233Reputation: 233
Quote:
Originally Posted by leamassiot View Post
@zhjim

I'm not sure that I understand what you've written here
The second entry is not ignored.
I wanted to express that the first ddns entry is the first one to come so it takes the record and shuts out the second attempt to ddns register the hostname a second time.
Maybe ignored is the wrong phrase but it does not take effect cause there already is a A record for that hostname.
 
  


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
how to make a network interfaces configuration immutable? jkbrown Linux - Networking 1 03-24-2011 07:39 PM
[SOLVED] /etc/network/interfaces configuration for virtual interfaces nonshatter Linux - Networking 4 10-25-2010 06:22 AM
[SOLVED] Sync PDA & other computers across home network lpallard Linux - Networking 1 04-21-2010 05:30 PM
Small Linux computers, extenders & wifi network johnnyboyx Linux - Newbie 1 05-18-2009 05:51 AM
problems in debian sarge with network interfaces configuration feloniousj Linux - Networking 3 11-14-2008 04:26 PM

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

All times are GMT -5. The time now is 10:52 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