Solved

reassigning hostname for a dialup server

Posted on 1997-11-17
2
266 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
Comment Utility
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
Comment Utility
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

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Join & Write a Comment

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…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

743 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now