Solved

reassigning hostname for a dialup server

Posted on 1997-11-17
2
271 Views
Last Modified: 2010-03-18
When I run my script to dial up my ISP, it automatically assigns it an IP address, and I want to know how to make it automatically assign a hostname. I'm using a script that calls pppd and uses chat.
0
Comment
Question by:ini_7
2 Comments
 

Accepted Solution

by:
serf earned 100 total points
ID: 1586866
I'm not sure if I've got the question right, but here goes answers to three versions of your question.

Answer 1.  Assume the question means that you want to assign hostname on your machine to the hostname assigned by your ISP for the IP address you're using.  If this is the case, then you could do some kind of reverse lookup to figure out your hostname.  Don't laugh, it's a bash script marvel...

  hostname $(host $(netstat -nr | awk '/ppp/{print $1}' | head -1) | awk '/Name/{print $2}')

Answer 2.  I assume that your ISP doesn't assign hostnames to each IP address, and you want a hostname to work with. Sorry, but you can't fix this problem.  Only your ISP has the DNS authority to assign those hostnames.

Answer 3.  I assume that your ISP does assign hostnames, but you want your own hostname to be assigned to whichever IP address you login to.  Unfortunately, you can't do this either.  First, only your ISP has the DNS authority to assign these hostnames, second, DNS caching would delay changes from propogating in a reasonable amount of time, and third, the reverse IP look up would still probably still point to the ISP's hostname.

Answer3b.   However, as long as your ISP is not too lazy and is using reasonable equipment, they should be able to dedicate an IP address/hostname to you.  You'd have to pay extra, but they'd be yours alone.

Hope these help.
0
 

Author Comment

by:ini_7
ID: 1586867
Answer #1 almost worked, but netstat -nr shows my routing table, which does not include my own ip address. ifconfig shows it on the line after the one that lists the ppp device and after the string "inet addr:", as does the last line of my /etc/hosts file (though the hostname is incorrect). I never learned awk by the way, perhaps you noticed.
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question