Solved

reassigning hostname for a dialup server

Posted on 1997-11-17
2
272 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

828 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