[prev in list] [next in list] [prev in thread] [next in thread] 

List:       dhcp-client
Subject:    problems w/ fully qualified domain names and DNS over DHCP
From:       Daniel Freedman <freedman () ccmr ! cornell ! edu>
Date:       2000-11-06 23:24:26
[Download RAW message or body]

   *** From dhcp-client -- To unsubscribe, see the end of this message. ***



Hi,

I'm having some difficulties using ISC's DHClient (Debian packaged
version) with my Debian 2.2 Linux box using a cable modem (dhcp) and
dynamic DNS. (And apologies upfront for the length of this email.) Here's
the background:

I've had the system working for awhile now with DHClient and fully
functional for web-browsing, ssh-sessions (in and out), IP-MASQ'ing for my
other two internal Linux boxes (192.168.0.2 and 192.168.0.3), etc. The
problem now, however, is that I want to be able to serve webpages and run
an MTA on the machine, and I'm having difficulty making the machine aware
of its fully-qualified domain name (Not that it probably matters, but I'm
obtaining a second-level domain, such as www.foobar.org, with dynamic dns
rather than the more common, for dynamic dns, third-level such as
foobar.dyndns.org).

If I had a static IP (obviously not using DHClient), this would probably
be easy and I could just place the ip address and FQDN in the /etc/hosts.
However, the way I have it currently configured (which isn't resolving the
FQDN, of course), is to only place the loopback address (as well as the
names and addresses in 192.168.xxx.xxx for my other home machines) in this
file.  I then obtain my current IP address fron DHCP by having
RoadRunner's (my cable provider) nameservers in my resolv.conf file.  

I've looked through the DHClient mailing-list archives and couldn't find
anything directly on target.  The funny thing is that the DHClient manpage
seems to give the answer to this problem, it's just that it doesn't seem
to work (at least for me, or I'm doing something wrong): the answer
appears to be to place:

        supersede host-name "fooserver1";
        supersede domain-name "foobar.org";

in the /etc/dhclient.conf file.  It seems that this is supposed to
override any assigned hostname and domainname with these choices.  The
problem is, is that when i boot up, the server still has no knowledge of
its FQDN, it only knows that its fooserver1.

The only means by which I've found some solution to this was posted as an
answer to my inquiry about this on a Debian mailing list.  Someone
suggested that I modify the standard dhclient-script to reference a little
script (/usr/local/bin/dyndns-update) that updates the dhcp-acquired ip
address in /etc/hosts to the new ip address, if it's changed.  The change
to dhclient-script is:

  if [ x$old_ip_address = x ] || [ x$old_ip_address != x$new_ip_address ]
|| \
     [ x$reason = xBOUND ] || [ x$reason = xREBOOT ]; then

    ifconfig $interface inet $new_ip_address $new_subnet_arg \
                                                        $new_broadcast_arg
    # DYNAMIC DNS UPDATE KLUDGE:
    /usr/local/bin/dyndns-update $new_ip_address 

Now, I fully recognize that this is a kludge (though I really appreciate
the person's help in getting me this far), since I recall Ted Lemon stated
on a number of occasions that changes to dhclient-script should be avoided
as they will break in version updates.  With this change I'm able to do a
hostname -f and see 'fooserver1.foobar.org' as expected.

My bottom-line question is really:  What am I doing wrong or what should I
be doing to achieve this the proper way?  What should my various config
files look like?

Any and all suggestions, pointers to more relevant information, etc. are
appreciated very much.  I've attached a bunch of relevant config files and
command outputs to the end of this to help provide info.

Thanks so very much for your help.

Take care,

Daniel



--------
Current scripts and command output (without above-mentioned kludge):
--------
[root@herc /etc]# cat /var/dhcp/dhclient.leases 
lease {
  interface "eth0";
  fixed-address 24.24.20.109;
  option subnet-mask 255.255.254.0;
  option time-offset -14400;
  option routers 24.24.20.1;
  option domain-name-servers 
24.92.226.12,24.92.226.173,24.92.226.174,24.92.226.171;
  option domain-name "twcny.rr.com";
  option dhcp-lease-time 28800;
  option dhcp-message-type 5;
  option dhcp-server-identifier 24.92.226.70;
  option dhcp-renewal-time 14400;
  option dhcp-rebinding-time 25200;
  option tftp-server-name "lms1.twcny.rr.com";
  renew 2 2000/11/7 01:12:27;
  rebind 2 2000/11/7 04:12:27;
  expire 2 2000/11/7 05:12:27;
}
[root@osprey /etc]# cat resolv.conf
search twcny.rr.com rr.com
nameserver 24.92.226.12
nameserver 24.92.226.173
nameserver 24.92.226.174
[root@osprey /etc]# cat hostname
osprey
[root@osprey /etc]# cat host.conf  
order hosts,bind
multi on
[root@osprey /etc]# cat hosts
127.0.0.1       localhost.localdomain   localhost
192.168.0.1     osprey
192.168.0.2     warthog
192.168.0.3     tomcat
[root@osprey /etc/network]# cat interfaces 
# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)

# The loopback interface
iface lo inet loopback

# The first network card - this entry was created during the Debian
installation
# 3c509 card used to interconnect internal network with DHCP server
iface eth0 inet dhcp

# The second network card (tulip) to communicate with internal network
iface eth1 inet static
      address 192.168.0.1
      netmask 255.255.255.0 

[root@osprey /etc]# /sbin/ifconfig
eth0      Link encap:Ethernet  HWaddr 00:A0:24:11:61:59  
          inet addr:24.24.20.109  Bcast:24.24.21.255  Mask:255.255.254.0
          UP BROADCAST RUNNING  MTU:1500  Metric:1
          RX packets:22990 errors:0 dropped:0 overruns:0 frame:0
          TX packets:17845 errors:0 dropped:0 overruns:0 carrier:0
          collisions:37 txqueuelen:100 
          Interrupt:5 Base address:0x300 

eth1      Link encap:Ethernet  HWaddr 00:A0:CC:E2:B5:29  
          inet addr:192.168.0.1  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:19367 errors:0 dropped:0 overruns:0 frame:0
          TX packets:14105 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100 
          Interrupt:11 Base address:0x1000 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:3924  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
[root@osprey /etc]# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use
Iface
192.168.0.0     *               255.255.255.0   U     0      0        0
eth1
24.24.20.0      *               255.255.254.0   U     0      0        0
eth0
default         ith2-a01.twcny. 0.0.0.0         UG    0      0        0
eth0









-----------------------------------------------------------------------
To unsubscribe from this list, visit http://www.isc.org/dhcp-lists.html
or send mail to dhcp-client-request@isc.org with the subject line of
'unsubscribe'.
-----------------------------------------------------------------------

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic