Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2010-09-16
14
Medium Priority
?
927 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
[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
  • 6
  • 3
  • 2
  • +2
14 Comments
 
LVL 4

Expert Comment

by:JDominguezNY
ID: 33695752
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
ID: 33695782
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
ID: 33695888
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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 74

Accepted Solution

by:
Glen Knight earned 2000 total points
ID: 33695904
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
ID: 33696178
>> 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
ID: 33696216
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
ID: 33696297
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
 
LVL 6

Expert Comment

by:crash2000
ID: 33699488
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
ID: 33700835
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
ID: 33700936
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
ID: 33700979
>> 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
ID: 33701400
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
ID: 33702676
Ok, thanks Mark.
0
 
LVL 40

Author Closing Comment

by:evilrix
ID: 33719329
Thanks.
0

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Originally, this post was published on Monitis Blog, you can check it here . It goes without saying that technology has transformed society and the very nature of how we live, work, and communicate in ways that would’ve been incomprehensible 5 ye…
If you’re involved with your company’s wide area network (WAN), you’ve probably heard about SD-WANs. They’re the “boy wonder” of networking, ostensibly allowing companies to replace expensive MPLS lines with low-cost Internet access. But, are they …
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

670 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