LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 05-29-2013, 06:45 PM   #1
nicklaszlo
LQ Newbie
 
Registered: Jan 2010
Posts: 14

Rep: Reputation: 0
Redirect/forward a domain locally


I frequently need to type in a long domain name "verylongdomainname.com". To save me some trouble, I want to create an alias so that on my machine I can just type "remote".

The /etc/hosts file lets me create an alias for an IP address, for example
127.0.0.1 localhost
allows me to type localhost instead of 127.0.0.1. Can I achieve the same thing for a domain name instead of an IP? The IP associated with the domain can change.

This is not a server question. I only want this alias to work on my own computer. However I want it to work in every application on the computer that uses DNS.

Thanks!
 
Old 05-30-2013, 03:34 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
you can put your own entry for the IP that the longname resolves to, but you can't trivially make one name become another without a DNS solution. Also a remote site may well ONLY respond to the right hostname.
 
Old 05-30-2013, 02:56 PM   #3
nicklaszlo
LQ Newbie
 
Registered: Jan 2010
Posts: 14

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by acid_kewpie View Post
Also a remote site may well ONLY respond to the right hostname.
I don't think that is a problem in this particular case.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Iptables: how to redirect locally-generated packets to a remote server? briwood Linux - Networking 28 02-16-2016 09:35 PM
apache redirect from new to old domain server, but browser visible old domain name hocheetiong Linux - Server 1 05-19-2013 04:28 PM
[SOLVED] Creating 301 Permanent Redirect to a domain with same docroot as old domain. MarkToronto Linux - Newbie 1 05-15-2013 03:35 AM
iptables: how to forward locally accessed port to a remote machine wastingtime Linux - Networking 1 04-06-2013 05:06 AM
how to port forward AND process locally as well? lynz Linux - Networking 2 09-27-2006 11:37 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:49 AM.

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