Is it possible to set up a Linux system so that it has a fixed IP address on the LAN but uses the addresses given to it by a router (using DHCP) for DNS?
Dynamic DNS updates - assuming you are using bind:
http://www.unix.com.ua/orelly/networking_2ndEd/dns/ch10_02.htm
On Monday 24 November 2008 16:28:15 Chris G wrote:
Is it possible to set up a Linux system so that it has a fixed IP address on the LAN but uses the addresses given to it by a router (using DHCP) for DNS?
-- Chris Green
main@lists.alug.org.uk http://www.alug.org.uk/ http://lists.alug.org.uk/mailman/listinfo/main Unsubscribe? See message headers or the web site above!
On Mon, Nov 24, 2008 at 04:39:35PM +0000, Stuart Bailey wrote:
On Monday 24 November 2008 16:28:15 Chris G wrote:
Is it possible to set up a Linux system so that it has a fixed IP address on the LAN but uses the addresses given to it by a router (using DHCP) for DNS?
Dynamic DNS updates - assuming you are using bind:
http://www.unix.com.ua/orelly/networking_2ndEd/dns/ch10_02.htm
Not quite what I meant. I'll try and clarify.....
I don't run a DNS server on any of the Linux boxes here. There are three Linux systems, one windows system and occasional visiting (usually Windows) systems. There are also a couple of printers and a DECT telephone system.
Currently most of the above have fixed IP addresses on the LAN and I have /etc/hosts (or the Windows equivalent) with the addresses in it. I manually set the DNS addresses in resolv.conf. Obviously 'visiting' systems use DHCP.
What I'd like to do is to have all systems use DHCP as then I wouldn't have to configure so much but it seems to me that I need fixed IPs for a number of things (the printers, some of the Linux systems, etc.). So if I could set a system's IP address but tell it to obtain everything else it needs to know (e.g. in particular the DNS server addresses) by DHCP it would make life much easier.
Alternatively I suppose I could set up bind in one of my Linux boxes and tell everything else to use that as the DNS server although even then I don't quite understand how things like printers work. If a printer acquires its IP address by DHCP how do you use it?
Why not configure DHCP to assign a given IP address to a MAC address. Thereby you are using a static IP from DHCP:
# Test server host test { hardware ethernet 00:1D:32:3C:DD:2C; fixed-address 192.168.0.253; ddns-hostname "test"; }
Obviously, I'm using DNS also.
On Monday 24 November 2008 17:28:13 Chris G wrote:
On Mon, Nov 24, 2008 at 04:39:35PM +0000, Stuart Bailey wrote:
On Monday 24 November 2008 16:28:15 Chris G wrote:
Is it possible to set up a Linux system so that it has a fixed IP address on the LAN but uses the addresses given to it by a router (using DHCP) for DNS?
Dynamic DNS updates - assuming you are using bind:
http://www.unix.com.ua/orelly/networking_2ndEd/dns/ch10_02.htm
Not quite what I meant. I'll try and clarify.....
I don't run a DNS server on any of the Linux boxes here. There are three Linux systems, one windows system and occasional visiting (usually Windows) systems. There are also a couple of printers and a DECT telephone system.
Currently most of the above have fixed IP addresses on the LAN and I have /etc/hosts (or the Windows equivalent) with the addresses in it. I manually set the DNS addresses in resolv.conf. Obviously 'visiting' systems use DHCP.
What I'd like to do is to have all systems use DHCP as then I wouldn't have to configure so much but it seems to me that I need fixed IPs for a number of things (the printers, some of the Linux systems, etc.). So if I could set a system's IP address but tell it to obtain everything else it needs to know (e.g. in particular the DNS server addresses) by DHCP it would make life much easier.
Alternatively I suppose I could set up bind in one of my Linux boxes and tell everything else to use that as the DNS server although even then I don't quite understand how things like printers work. If a printer acquires its IP address by DHCP how do you use it?
-- Chris Green
main@lists.alug.org.uk http://www.alug.org.uk/ http://lists.alug.org.uk/mailman/listinfo/main Unsubscribe? See message headers or the web site above!
On Mon, Nov 24, 2008 at 05:41:04PM +0000, Stuart Bailey wrote:
Why not configure DHCP to assign a given IP address to a MAC address. Thereby you are using a static IP from DHCP:
# Test server host test { hardware ethernet 00:1D:32:3C:DD:2C; fixed-address 192.168.0.253; ddns-hostname "test"; }
Obviously, I'm using DNS also.
Is that bind configuration? It looks as if that might be the way to go if none of my routers can help me.
On Monday 24 November 2008 17:28:13 Chris G wrote:
On Mon, Nov 24, 2008 at 04:39:35PM +0000, Stuart Bailey wrote:
On Monday 24 November 2008 16:28:15 Chris G wrote:
Is it possible to set up a Linux system so that it has a fixed IP address on the LAN but uses the addresses given to it by a router (using DHCP) for DNS?
Dynamic DNS updates - assuming you are using bind:
http://www.unix.com.ua/orelly/networking_2ndEd/dns/ch10_02.htm
Not quite what I meant. I'll try and clarify.....
I don't run a DNS server on any of the Linux boxes here. There are three Linux systems, one windows system and occasional visiting (usually Windows) systems. There are also a couple of printers and a DECT telephone system.
Currently most of the above have fixed IP addresses on the LAN and I have /etc/hosts (or the Windows equivalent) with the addresses in it. I manually set the DNS addresses in resolv.conf. Obviously 'visiting' systems use DHCP.
What I'd like to do is to have all systems use DHCP as then I wouldn't have to configure so much but it seems to me that I need fixed IPs for a number of things (the printers, some of the Linux systems, etc.). So if I could set a system's IP address but tell it to obtain everything else it needs to know (e.g. in particular the DNS server addresses) by DHCP it would make life much easier.
Alternatively I suppose I could set up bind in one of my Linux boxes and tell everything else to use that as the DNS server although even then I don't quite understand how things like printers work. If a printer acquires its IP address by DHCP how do you use it?
-- Chris Green
main@lists.alug.org.uk http://www.alug.org.uk/ http://lists.alug.org.uk/mailman/listinfo/main Unsubscribe? See message headers or the web site above!
--
Stuart Bailey BSc (hons) CEng CITP MBCS LinuSoft (Owner) Linux Specialist (0845) 6583563 http://www.linusoft.co.uk http://www.bluetoothadvertising.org.uk
-- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.
main@lists.alug.org.uk http://www.alug.org.uk/ http://lists.alug.org.uk/mailman/listinfo/main Unsubscribe? See message headers or the web site above!
On Mon, Nov 24, 2008 at 04:28:15PM +0000, Chris G wrote:
Is it possible to set up a Linux system so that it has a fixed IP address on the LAN but uses the addresses given to it by a router (using DHCP) for DNS?
Why do you want to statically configure IP but are unable to statically configure DNS?
I believe the normal route for this sort of thing is to configure the DHCP server to hand out a static IP for a given MAC address. Even the consumer level routers I've seen can do this.
J.
On 24 Nov 17:23, Jonathan McDowell wrote:
On Mon, Nov 24, 2008 at 04:28:15PM +0000, Chris G wrote:
Is it possible to set up a Linux system so that it has a fixed IP address on the LAN but uses the addresses given to it by a router (using DHCP) for DNS?
Why do you want to statically configure IP but are unable to statically configure DNS?
I believe the normal route for this sort of thing is to configure the DHCP server to hand out a static IP for a given MAC address. Even the consumer level routers I've seen can do this.
Bingo, that's what we generally do (though, we also generally have a DNS server or two laying about on the lan :)
Cheers,
On Mon, Nov 24, 2008 at 05:23:13PM +0000, Jonathan McDowell wrote:
On Mon, Nov 24, 2008 at 04:28:15PM +0000, Chris G wrote:
Is it possible to set up a Linux system so that it has a fixed IP address on the LAN but uses the addresses given to it by a router (using DHCP) for DNS?
Why do you want to statically configure IP but are unable to statically configure DNS?
I believe the normal route for this sort of thing is to configure the DHCP server to hand out a static IP for a given MAC address. Even the consumer level routers I've seen can do this.
Yes, I can get my router to do that but it doesn't give a name to the MAC address does it. My current /etc/hosts file is:-
192.168.1.1 vigor 2820n 192.168.1.4 home.isbd.net home 84-45-228-40.no-dns-yet.enta.net 192.168.1.5 chris 192.168.1.6 maxine 192.168.1.7 nas garage 192.168.1.44 hp7310 HPEDDBB7 HP000D9D068F7D 192.168.13.254 2wire BT2700HGV gateway.2wire.net
I'd really prefer not to have to copy that to every system. I'm sure I once had a router that actually had a DNS server in it where I could have stored the above but neither of my current routers (two ADSL lines, hence the vigor *and* 2wire above) has this ability.
On Mon, Nov 24, 2008 at 05:34:21PM +0000, Chris G wrote:
On Mon, Nov 24, 2008 at 05:23:13PM +0000, Jonathan McDowell wrote:
On Mon, Nov 24, 2008 at 04:28:15PM +0000, Chris G wrote:
Is it possible to set up a Linux system so that it has a fixed IP address on the LAN but uses the addresses given to it by a router (using DHCP) for DNS?
Why do you want to statically configure IP but are unable to statically configure DNS?
I believe the normal route for this sort of thing is to configure the DHCP server to hand out a static IP for a given MAC address. Even the consumer level routers I've seen can do this.
Yes, I can get my router to do that but it doesn't give a name to the MAC address does it.
Did on my Netgear and my BT Home Hub, even before I reflashed with OpenWRT (and thus got the lovely dnsmasq). You can always run the DHCP server somewhere more sensible and point it at the DNS server on the router if required. I don't know anything about the Vigor or 2wire routers (and cba Googling) but I'd be surprised if they had no way to add hostnames for local IPs.
J.
On Mon, Nov 24, 2008 at 05:39:14PM +0000, Jonathan McDowell wrote:
On Mon, Nov 24, 2008 at 05:34:21PM +0000, Chris G wrote:
On Mon, Nov 24, 2008 at 05:23:13PM +0000, Jonathan McDowell wrote:
On Mon, Nov 24, 2008 at 04:28:15PM +0000, Chris G wrote:
Is it possible to set up a Linux system so that it has a fixed IP address on the LAN but uses the addresses given to it by a router (using DHCP) for DNS?
Why do you want to statically configure IP but are unable to statically configure DNS?
I believe the normal route for this sort of thing is to configure the DHCP server to hand out a static IP for a given MAC address. Even the consumer level routers I've seen can do this.
Yes, I can get my router to do that but it doesn't give a name to the MAC address does it.
Did on my Netgear and my BT Home Hub, even before I reflashed with OpenWRT (and thus got the lovely dnsmasq). You can always run the DHCP server somewhere more sensible and point it at the DNS server on the router if required. I don't know anything about the Vigor or 2wire routers (and cba Googling) but I'd be surprised if they had no way to add hostnames for local IPs.
The 2wire router is a BT Business Hub, it's a bit 'locked down' by BT I think though. The Vigor is the Draytek Vigor 2820n, it does the load balancing between its ADSL connection and the BT router's ADSL connection.
I also have two other routers lying around (a Speedtouch 716wl and a Zyxel 660h), I can't see anywhere that any of them would allow putting local IP *names* against IP addresses. I could quite easily replace the BT 2Wire router with either of these if they *did* allow entry of name/IP pairs.
On Mon, 24 Nov 2008 17:34:21 +0000 Chris G cl@isbd.net allegedly wrote:
Yes, I can get my router to do that but it doesn't give a name to the MAC address does it. My current /etc/hosts file is:-
192.168.1.1 vigor 2820n 192.168.1.4 home.isbd.net home
84-45-228-40.no-dns-yet.enta.net 192.168.1.5 chris 192.168.1.6 maxine 192.168.1.7 nas garage 192.168.1.44 hp7310 HPEDDBB7 HP000D9D068F7D 192.168.13.254 2wire BT2700HGV gateway.2wire.net
I'd really prefer not to have to copy that to every system. I'm sure I once had a router that actually had a DNS server in it where I could have stored the above but neither of my current routers (two ADSL lines, hence the vigor *and* 2wire above) has this ability.
Use DNSmasq. Set up one of the mcahines as a DNS server and point all the others at that for resolution. The DNSmasq server can use a single local hosts file to resolve all internal local addresses (usually from RFC 1918) and forward to a downsteram server at your ISP for any non-local addresses.
One useful side effect of this approach is that you can tack on to the hosts file a list of known "bad" hosts (such as the one at http://someonewhocares.org/hosts/. This will then block any connections to cruddy porn/malware/warez/advertising sites listed.
Oh and DNSMasq will act as a DHCP server and can allocate "static" addresses according to MAC addresses mapped in the local /etc/ethers.
Of course you will have to turn off DHCP from any routers on your network or you may get some funny results.
Mick
---------------------------------------------------------------------
The text file for RFC 854 contains exactly 854 lines. Do you think there is any cosmic significance in this?
Douglas E Comer - Internetworking with TCP/IP Volume 1
http://www.ietf.org/rfc/rfc854.txt ---------------------------------------------------------------------
On Mon, Nov 24, 2008 at 08:57:51PM +0000, mbm wrote:
On Mon, 24 Nov 2008 17:34:21 +0000 Chris G cl@isbd.net allegedly wrote:
Yes, I can get my router to do that but it doesn't give a name to the MAC address does it. My current /etc/hosts file is:-
192.168.1.1 vigor 2820n 192.168.1.4 home.isbd.net home
84-45-228-40.no-dns-yet.enta.net 192.168.1.5 chris 192.168.1.6 maxine 192.168.1.7 nas garage 192.168.1.44 hp7310 HPEDDBB7 HP000D9D068F7D 192.168.13.254 2wire BT2700HGV gateway.2wire.net
I'd really prefer not to have to copy that to every system. I'm sure I once had a router that actually had a DNS server in it where I could have stored the above but neither of my current routers (two ADSL lines, hence the vigor *and* 2wire above) has this ability.
Use DNSmasq. Set up one of the mcahines as a DNS server and point all the others at that for resolution. The DNSmasq server can use a single local hosts file to resolve all internal local addresses (usually from RFC 1918) and forward to a downsteram server at your ISP for any non-local addresses.
One useful side effect of this approach is that you can tack on to the hosts file a list of known "bad" hosts (such as the one at http://someonewhocares.org/hosts/. This will then block any connections to cruddy porn/malware/warez/advertising sites listed.
Oh and DNSMasq will act as a DHCP server and can allocate "static" addresses according to MAC addresses mapped in the local /etc/ethers.
Of course you will have to turn off DHCP from any routers on your network or you may get some funny results.
Sounds just what I want, thanks!
On Mon, Nov 24, 2008 at 11:22:36PM +0000, Chris G wrote:
On Mon, Nov 24, 2008 at 08:57:51PM +0000, mbm wrote:
I'd really prefer not to have to copy that to every system. I'm sure I once had a router that actually had a DNS server in it where I could have stored the above but neither of my current routers (two ADSL lines, hence the vigor *and* 2wire above) has this ability.
Use DNSmasq. Set up one of the mcahines as a DNS server and point all the others at that for resolution. The DNSmasq server can use a single local hosts file to resolve all internal local addresses (usually from RFC 1918) and forward to a downsteram server at your ISP for any non-local addresses.
One useful side effect of this approach is that you can tack on to the hosts file a list of known "bad" hosts (such as the one at http://someonewhocares.org/hosts/. This will then block any connections to cruddy porn/malware/warez/advertising sites listed.
Oh and DNSMasq will act as a DHCP server and can allocate "static" addresses according to MAC addresses mapped in the local /etc/ethers.
Of course you will have to turn off DHCP from any routers on your network or you may get some funny results.
Sounds just what I want, thanks!
Now I've taken a look it is *exactly* what I want, thank you.