Solved

reassigning hostname for a dialup server

Posted on 1997-11-17
2
281 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

More Than Just A Video Library

Train for your certification. Learn the latest DevOps tools. Grow your skillset to do better work.

At Linux Academy, we release new training modules every week so you'll always be up to date on the latest tech.

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…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…

635 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