Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have a Debian Linux server running on my local network. I also have port forwarding set up on my router so that computers outside my network can use my domain name and get to my website/FTP/SSH Server. That works perfectly.

When I enter the domain name (or even the public ip address) on the local network however, it times out. To make it work I use the private IP address of the server when at home. This works ok, but it makes things a bit messy. If it's possible I'd like that domain name to resolve to the private address when on the local network.

I've done a fair bit of Google searching and I think I need to set up split DNS or maybe dnsspoof. I have no idea how to set up a split DNS and I haven't been able to find a good tutorial for it, but I did follow this tutorial on setting up dnsspoof and I couldn't get it to work.

Currently I have bind9 running in a chrooted environment, but have not idea if I'm actually using it.

Any suggestions?

share|improve this question
    
This likely wouldn't require split DNS. Assuming your external DNS is hosted elsewhere you could simply setup your local DNS server with a single view, the one you want for the internal hosts. The internal hosts would then be configured to check with that server, and it would return the local response. Other hosts would not be looking at your DNS server, so would get the response from the existing server. –  qqx Nov 25 '12 at 2:28
    
@qqx a local server that serves one version of the zone file, and another server elsewhere that serves the public version of the same zone. That's pretty much the definition of split DNS! –  Celada Nov 25 '12 at 2:46
    
@Celada I was referring to the feature in BIND to have a single named return different information based on where the request is coming from. –  qqx Nov 25 '12 at 3:17
4  
There's always /etc/hosts. Not as cool, but may be less effort depending on the number of machines you are managing. –  donothingsuccessfully Nov 25 '12 at 6:42
    
@qqx Thanks for you help. I've used this tutorial and I feel like it's set up correctly. To use it on my machine I changed /etc/resolv.conf. Now when I ping the domain it says the host is unknown. This is starting to seems like more effort than it's worth. On top of that I don't think my router will let me change any DNS settings. –  colton7909 Nov 25 '12 at 17:09
add comment

1 Answer

Simple use /etc/hosts: add your domain name to the private IP address.

share|improve this answer
    
I thought about that, but it's not a good solution for me. Many of the devices will be accessing the server from both inside and outside the network so it must be dynamic. Also I need it to work for devices I'm not an administrator of. –  colton7909 Nov 25 '12 at 15:37
add comment

Your Answer

 
discard

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

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