Solved

Without using DNS is it possible to give a host name a local alias?

Posted on 2010-09-16
14
910 Views
Last Modified: 2012-05-10
Imagine we have a server called foo.org and this is a fully fledged DNS on the internet. Is it possible for me to set up a local name alias on my Windows 7 home laptop so that I can refer to it as (for example) bar? Is there any way this can be done using just what comes with Windows (ie. I don't want to install and configure a local DNS). I thought about using the hosts file but this requires an IP address in the first field and I don't want to set a fixed IP, I just want to use a local alias.

This seems like such a simple and trivial thing to want to do and yet I can't find a simple answer via Google (and I got bored trying).

Thanks.
0
Comment
Question by:evilrix
  • 6
  • 3
  • 2
  • +2
14 Comments
 
LVL 4

Expert Comment

by:JDominguezNY
Comment Utility
If it's just on a single PC you can enter it into the hosts file.

hostname      0.0.0.0
0
 
LVL 4

Expert Comment

by:JDominguezNY
Comment Utility
Sorry I misunderstood,

Are you looking to get a hostname so that you can access your network from the internet?
0
 
LVL 9

Expert Comment

by:vanbarsoun
Comment Utility
You can set up the hosts file with the name you want to use and the actual IP of the server. So you're not setting a fixed IP, you're just telling your computer where to go when your type in your alias.
0
 
LVL 74

Accepted Solution

by:
Glen Knight earned 500 total points
Comment Utility
Saddly this is not possible with simple host files as CNAMES are not supported.

Your best bet is to download a free DNS service like BIND: http://www.isc.org/software/bind and use that.

My preference would be to use a virtual machine but that's your choice :)
0
 
LVL 40

Author Comment

by:evilrix
Comment Utility
>> You can set up the hosts file with the name you want to use and the actual IP of the server.

I could, but that's not what I want to do :)

Basically, I want to be able to assume the IP isn't fix but the hostname is... but I want to be able to alias it. I could bore the pants off you and explain why but let's just assume I have a good reason for wanting to be able to do this if it is at all possible (it is becoming clear it isn't).

demazter - Bingo, I want to be able to emulate CNAMES (well, just one) without the use of DNS. However, I can see that local DNS may be my only option.

I'll let this stand for a bit to give others a chance to opine otherwise I will accept "it cannot be done" and use Bind as the solution.

Thanks.
0
 
LVL 9

Expert Comment

by:vanbarsoun
Comment Utility
You can have the server use Dynamic Dns service (if you have access to it and are willing), then that way you always refer to the server with the same DNS name, even if the actual IP of the server changes.
0
 
LVL 40

Author Comment

by:evilrix
Comment Utility
vanbarsoun, thanks but (a) the server is not mine to install DDNS onto and (b) I have a very specific alias name I need to use.
0
Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

 
LVL 6

Expert Comment

by:crash2000
Comment Utility
Hi Evilrix,

OK thinking aloud here. But could you set up a local IIS server on your local machine and have that point to the other server? I think this is called IIS redirections.

Hope that helps

Mark
0
 
LVL 40

Author Comment

by:evilrix
Comment Utility
I don't know, could I? :)

I already have IIS set up and hosting development sites. I am not looking for a HTTP alias, it has to be a full blow CNAME alias.
0
 
LVL 6

Expert Comment

by:crash2000
Comment Utility
Hi Evilrix,

It depends on what you want to achieve. But maybe an HTTP alias would do what you wanted.
You could set up a local webserver called "bar".
Then setup a "bar 127.0.0.1" in your hosts file. so it points locally.
Then in IIS set bar to forward to foo.org as per this
http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/6b855a7a-0884-4508-ba95-079f38c77017.mspx?mfr=true

I have never tried this but I can't see why it won't work.

Mark
0
 
LVL 40

Author Comment

by:evilrix
Comment Utility
>> But maybe an HTTP alias would do what you wanted

"I am not looking for a HTTP alias, it has to be a full blow CNAME alias"

I am not trying to redirect HTTP requests... this has nothing to do with HTTP. I need a full hostname alias that will work under all circumstances for all protocols. Like I've said already I want to emulate CNAME without DNS.

http://en.wikipedia.org/wiki/CNAME_record

If I ping bar I want to alias to foo.com.

>> I have never tried this but I can't see why it won't work.

See above.
0
 
LVL 6

Expert Comment

by:crash2000
Comment Utility
Hi Evilrix,

In which case, I beleive it cannot be done. ou have to have DNS in order to use a CName. My solution was just a possible workaround and may have helped. But as you say it is http.

Sorry I can't help further.

Mark
0
 
LVL 40

Author Comment

by:evilrix
Comment Utility
Ok, thanks Mark.
0
 
LVL 40

Author Closing Comment

by:evilrix
Comment Utility
Thanks.
0

Featured Post

Give your grad a cloud of their own!

With up to 8TB of storage, give your favorite graduate their own personal cloud to centralize all their photos, videos and music in one safe place. They can save, sync and share all their stuff, and automatic photo backup helps free up space on their smartphone and tablet.

Join & Write a Comment

OfficeMate Freezes on login or does not load after login credentials are input.
When it comes to security, there are always trade-offs between security and convenience/ease of administration. This article examines some of the main pros and cons of using key authentication vs password authentication for hosting an SFTP server.
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

728 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

9 Experts available now in Live!

Get 1:1 Help Now