Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm trying to move my development stuff over to a small local Debian based server running ispconfig, and need to basically make it so that *.dev is routed to a specific IP. So for example I went to http://some-site.dev it would go to

Is there any way of doing this without a fancy/expensive router?


share|improve this question

closed as not a real question by MDMarra, Scott Pack, mailq, HopelessN00b, Lucas Kauffman Sep 30 '12 at 9:46

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

It's really not clear what it is you're trying to do. But it sounds like all you need to do is run bind on that machine, make it authoritative for dev. and put in a wildcard entry for *.dev that maps to –  David Schwartz Feb 23 '12 at 23:29
Thanks David, would I be right in thinking I then just have an extra dns record on each computer for the bind server? –  Rick Feb 23 '12 at 23:39
Each local computer would have to use that machine as its DNS server. –  David Schwartz Feb 23 '12 at 23:49
add comment

2 Answers

up vote 1 down vote accepted

In Windows, I would say 'modify your hosts file'. It turns out that my answer is exactly the same for Mac. The link will show you how to modify the HOSTS file in OSX, allowing you to resolve specific hostnames (such as http://site-name.dev) on a network where you have no DNS server.

Since my answer was downvoted, I figured I might as well expand on WHY I think this is the best option for you. Here's a Microsoft article explaining the concept of hosts files (it also touches on the idea that *nix-based systems have the same file) and here's a great blog post touching on the same thing, with the content focused on Mac's.

Before DNS was prevalent, the hosts file was the way to go for specific name resolution. Since you do not have a DNS server (and building one can be a PITA, and overkill for what you explained you needed) just use the hosts file.

share|improve this answer
Why the downvote? Because it's the right answer? :) –  JohnThePro Feb 24 '12 at 15:03
Hi John, thanks for your answer - not sure who downvoted you but it wasn't me :) I'll possibly end up having to continue editing the hosts file for each record. It's just a bit os a pain as you cant do a wildcard entry for a TLD on the OSX/NIX hosts file. –  Rick Feb 24 '12 at 15:44
Unfortunately, yes. No wildcard support, but still a bit easier than getting a DNS server set up. –  JohnThePro Feb 24 '12 at 15:49
Yes, very true! . –  Rick Feb 24 '12 at 15:50
add comment

The only way this would be possible would be by hosting your own DNS server and setting up a wildcard rule that resolves all *.dev to a specific address.

Alternatively, if you're only going to be doing this for one machine, dnsmasq appears to do what you're asking. On your workstation;

echo "  dev" >> /etc/hosts
sudo port install dnsmasq
echo "address=/.dev/" >> /opt/local/etc/dnsmasq.conf
open your network settings and add as a dns server
ping a *.dev domain to see if the dns forward has worked

If it does work, whenever you enter a *.dev domain, it will automatically forward you to

share|improve this answer
DNS masq can be used for more then just your local machine, it is the DNS server built-in to the firmware of many router appliances. –  Zoredache Feb 23 '12 at 23:53
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.