[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: New ip-up (Was: Re: REQ ip-up: run-parts /etc/ppp/up )



On Mon, 20 Oct 1997, Jeff Sheinberg wrote:
> > hostname \
> > ` \
> >     ifconfig ppp0|awk '$0 ~ /inet/ {FS=":"; $0=$2; print $2}'| \
> >     nslookup|awk '$0 ~/^Name/ {print $2}' \
> > `
> 2) Note that $4 contains the local ip address, so the ifconfig part
>    is not needed, just : nslookup $4 | ...etc.

Ok.  Good point.

> 3) Not every ip address has a reverse name lookup entry in the DNS, your
>    script needs to check for this.

When you connect to your ISP via ppp, they are supposed to have a hostname
for you.  Anyhow, the script would just have an error in that case.
However, I will look into it.

> 4) What about a host that has multiple ppp connections, are you going to
>    change the hostname to the last one that has come up?  And, what is
>    ppp-down going to do as the interfaces go down in random order?

You are right, this only covers the case of a single ppp interface.

Can anyone suggest correct behavior for multiple cases?
For instance, if an nslookup of the current hostname is valid, to do
nothing?

How do we do that?  How do I detect if nslookup didnt find a matching
hostname?

> 5) smail -q : this should be `runq' or the sendmail equivalent that is
>    supported both by smail & sendmail.

sendmail -q it is.

>    I tried looking at the Host Requirements RFCs 1122, 1123, and 1127,
>    but all I found was mention that RFC 822 deprecates the use of
>    hostnames that are not fully qualified.  So, does anyone know what
>    the hostname of a dial-up connection with dynamic ip address should be?

What the ISP assigns to it. eg, citytelprct95.citytel.net.  Each ISP seems
to have its own naming conventions, involving a number, such as 1, 123,
243 etc plus some prefix (eg, ip2, ppp34,) suffixed by the domain.

Here is the new script:

#!/bin/sh
# /etc/ppp/ip-up                     jwalther@citytel.net   Oct 19, 1997
#
# Sets the hostname of your machine to that returned by a DNS lookup on
# your current IP.
#   hostname `nslookup $4|awk '$0 ~/^Name/ {print $2}'`
#
# sendmail -q makes sure any pending mail is sent as soon as possible.

hostname `nslookup $4|awk '$0 ~/^Name/ {print $2}'`
sendmail -q

# End of /etc/ppp/ip-up

Cheers,

Jonathan


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-devel-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .


Reply to: