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 have a Ubuntu server on my local network that I use as a development platform for websites. I was just wondering if it was possible to setup a DNS server and route whatever .com name I want to it, instead of 192.168.x.x?

I know that I could buy a domain, and point it to my server. Two problems with that though; one...I have to buy a domain for the sake of me being too lazy to type in an ip, and, two, I would have to put my machine on the internet and I don't really want to do that.

So, as a fun little thing to do would it be possible to create my own top level domain?

share|improve this question

migrated from stackoverflow.com Nov 25 '10 at 6:28

This question came from our site for professional and enthusiast programmers.

    
This should be a question on Serverfault.com –  Erik Philips Nov 25 '10 at 4:39
1  
While it does belong on serverfault, the answer is yes. If you only want it accessible from a few machines, you can set up the HOSTS file to point to them instead of using a DNS. –  Jerry Coffin Nov 25 '10 at 4:45
add comment

4 Answers

The simple answer is - yes. But if you plan to expose your server to the Internet some day, consider buying domain. Later, it could cost a lot of effort to migrate from "private" domain to "production" all your applications and servers.

share|improve this answer
add comment

Another option if it is just for local network names is to use avahi. This can publish your local computers names on the local network. Try accessing systems via "systemname.local". See this link for more information about the local domain and Avahi options.

You tagged it as "ubuntu", and I believe Ubuntu comes configured for this by default.

share|improve this answer
add comment

You can just simply put the entries you want in your /etc/hosts file. Make sure that the line in your /etc/nsswitch.conf file that deals with hosts starts with files e.g.

hosts:             files mdns4_minimal [NOTFOUND=return] dns mdns4
share|improve this answer
add comment

Yes. The computers have no way of telling the difference. There are many different available DNS servers. One relatively simple one is dnsmasq. It even lets you load the DNS mappings from your /etc/hosts file.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.