Solved

reassigning hostname for a dialup server

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

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

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…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

863 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

20 Experts available now in Live!

Get 1:1 Help Now