LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-21-2009, 10:34 AM   #1
aspedisca
LQ Newbie
 
Registered: Dec 2008
Posts: 20

Rep: Reputation: 0
Taking a specific ip to my local webserver


Hi all,

For some purpose in my home network I want to get a specific ip to my localhost on that machine.

Like say I typed 123.123.123.123 I want that go to localhost.

How can I do this.

Thank you
 
Old 10-21-2009, 05:51 PM   #2
normscherer
Member
 
Registered: Sep 2005
Location: Prescott, AZ
Distribution: Ubuntu Mate 18 LTS
Posts: 50

Rep: Reputation: 15
Quote:
Originally Posted by aspedisca View Post
Hi all,

For some purpose in my home network I want to get a specific ip to my localhost on that machine.

Like say I typed 123.123.123.123 I want that go to localhost.

How can I do this.

Thank you
I'm not sure I understand what you are trying to do. If you are trying to assign a given ip address to your host you can do that in /etc/hosts (try man hosts). You need to be aware that ip addresses are assigned on a global basis and you can not just use one like the one you gave as an example. Specific address groups are allocated for private network use and may be used by anyone. Examples are 192.168.nnn.nnn for class c networks.

Norm
 
Old 10-21-2009, 11:15 PM   #3
aspedisca
LQ Newbie
 
Registered: Dec 2008
Posts: 20

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by normscherer View Post
I'm not sure I understand what you are trying to do. If you are trying to assign a given ip address to your host you can do that in /etc/hosts (try man hosts). You need to be aware that ip addresses are assigned on a global basis and you can not just use one like the one you gave as an example. Specific address groups are allocated for private network use and may be used by anyone. Examples are 192.168.nnn.nnn for class c networks.

Norm


Hi,

Thank you for your help but I should try to be more clear I guess.
For example there is a website like linuxquestions.com and at home when I type the ip of this website I would like it to take me to my localhost. Sounds silly for this case I know...

I have a device always trying to connect to a website and basically I am planning to give it my localhost and config files at localhost.

I did this with a weird way though but I believe there should be a way to do this in linux and I wonder how I can do it.

Thank you
 
Old 10-25-2009, 07:09 PM   #4
normscherer
Member
 
Registered: Sep 2005
Location: Prescott, AZ
Distribution: Ubuntu Mate 18 LTS
Posts: 50

Rep: Reputation: 15
You should be able to put an entry in /etc/hosts

Something like this

127.0.0.0 localhost somehost.somedomain

There is really no reasonable way I know of to make it connect to the localhost given the ip address of another site. As I show you can short circuit the name to address translation by having an entry in your /etc/hosts file.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
saving files on local disk in VIM/EMACS taking 5+ seconds hedpe Linux - Software 9 01-08-2008 04:19 PM
Local webserver -- How to deny all client install their local web server--Please help b:z Linux - Networking 13 04-16-2005 07:11 PM
X jams taking local peripherals with it Artanicus Linux - Software 1 01-07-2005 01:05 PM
IPTABLES and local Webserver mpgram Linux - Security 4 05-06-2004 12:11 PM
Looking for specific linux distro -- Help me set up a webserver flamesrock Linux - Software 7 03-04-2004 07:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:01 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration