http://qa.mandrakesoft.com/show_bug.cgi?id=4227





------- Additional Comments From [EMAIL PROTECTED]  2003-21-09 01:39 -------
Damien: I did a simple trace on ifup-post and I found out why it does not 
perform a reverse lookup for my hostname. 
 
--------- beginning of segment from ifup-post -------------- 
if [ "$2" = "boot" -a \ 
     "${DEVICE}" != lo -a \ 
     "${DEVICETYPE}" != "ppp" -a \ 
     "${DEVICETYPE}" != "slip" ]; then 
    if need_hostname; then 
        IPADDR=`LANG= LC_ALL= ifconfig ${DEVICE} | grep 'inet addr' |  
                awk -F: '{ print $2 } ' | awk '{ print $1 }'` 
        eval `/bin/ipcalc --silent --hostname ${IPADDR}` 
        if [ "$?" = "0" ]; then 
            set_hostname $HOSTNAME 
        fi 
    fi 
fi 
--------- end of segment from ifup-post -------------- 
 
If you look at the function need_hostname, found in network-functions, then it 
is very simple 
 
--------- beginning of segment from network-functions -------------- 
need_hostname () 
{ 
    CHECK_HOSTNAME=`hostname` 
    if [ "$CHECK_HOSTNAME" = "(none)" -o "$CHECK_HOSTNAME" = "localhost" -o \ 
        "$CHECK_HOSTNAME" = "localhost.localdomain" ]; then 
        return 0 
    else 
        return 1 
    fi 
} 
--------- end of segment from network-functions -------------- 
Therefore, it is no wonder that ifup-post does not reset the hostname, because 
the need_hostname function only checks to see that one has a hostname and does 
not check to see if it is a valid one. When need_hostname is called, I have 
already received the faulty hostname so need_hostname returns 1. 

-- 
Configure bugmail: http://qa.mandrakesoft.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


------- Reminder: -------
assigned_to: [EMAIL PROTECTED]
status: REOPENED
creation_date: 
description: 
drakxtools-newt-9.2-0.18mdk

Here is a feature that I sorely miss and would have to be added to drakconnect
and, I presume, initscripts as well.

My home computer gets a dhcp address from a cable modem. The IP address I get is
a valid address, but the hostname that the dhcp server inside the cable modem
gives me is not. An example would be:
IP address: 24.241.233.100
hostname: dhcp-100

What I would like is an option that sets the hostname as the reverse lookup for
the IP address that I have been allotted.
In this case, the command 
host 24.241.233.100 gives me the address: 
c24.241.233.100.jvl.wi.charter.com and that's what I want as my hostname.


Let me be clear about this: The solution may consist of switching dhcp clients
or editing some init files, but I really want this to be done in an easy manner
through the GUI in drakconnect.

Reply via email to