How can we set up a domain name in our own dns server? - networking

I want to host my website from my home using a server and I also want to know if I can register my own domain name using my DNS server! If yes it would be really helpful on how to do so!
Thank you very much!

Setting up a home web server is simple. If you do it though, check and make sure that your ISP allows you to do so. Here is my recommendation to begin:
Register your domain name with godaddy.com, register.com or whomever you choose (ie.www.xyz.com)
Determine whether you will have a public dynamic IP address (will change constantly) or a static ip address (usually have to pay for this from your ISP)
DNS Setup
a. If you are using a public dynamic IP address (which I am sure you are in this case), then set up a dynamic dns free account (go here - http://www.dyndns.com/services/dns/dyndns/). You will need to set up a username and password, which you will later use on the DynDNS Updater you will need to install on your Windows web server. Create the zone for your domain (ie. xyz.com is a zone you create).
b. If you are using a static IP address, then make sure the name servers are 'Parked' with your domain provider, then set up a forward to the public static IP address of your home network (from here, you just set up port forwarding in your router/gateway to your web server and you should be done)
Web Server Configuration
I. set up a 'static' ip address on your network card which will manage the incoming connections. Make sure that IIS is listening for requests through this IP address via IIS Manager.
II. If you are going to use the dynamic dns configuration for DNS, then download the DynDNS Updater app to your windows server and it will manage the connection between your web server dns and dynamic dns servers (this is cool and easy)
III. Set up a test index.html in IIS Manager for your 'Default Site'. Open a web browser and open 'http://localhost' to make sure you can access the site.
IV. Make sure your Windows firewall allows traffic through port 80.
Router / Gateway Configuration - go to 'Port Forwarding', and forward all requests via port '80' to the static ip address of your webserver (ie. Allow Incoming Port '80' to 192.168.x.x')
From your web server, Go to 'http://www.whatismyip.com and see what your public ip address is.
Once your IIS is set up, your port forwarding has been configured, and dynamic dns is updated, ping the domain you registered 'ie. www.xyz.com' and see if it matches the IP address of your web server public ip.
From outside your local area network, try to access your domain 'http://www.xyz.com'. If success, then you are good to go. If no success, review all these steps again.

Related

Local DNS override works randomly with Bind

I have a Bind DNS server on my local network to get *.home resolution, and a forwarders section for every other domains. I also have a local web server which serve some subdomains of *.mydomain.com from the outside, with my ISP box redirecting ports 80/443 to it.
But from any computer within my local network, if I try to access any of the *.mydomain.com address, the IP address returned is my public IP address and the ISP box doesn't redirect the request to my server. I used a workaround by adding the subdomains *.mydomain.com with the local IP address of the server in /etc/hosts on each local computer but it's not perfect since I have to change it if I move a computer to another network, plus I can't do this on my non-rooted Android devices.
The perfect solution would be to have my local DNS overrinding the DNS entries for *.mydomain.com with the local IP instead of the public one. I tried some Bind9 configurations for this, some using the "response-policy" directive, some without it, but in every case, I get the external IP ~50% of the time and I can't figure out why. This happens on every computer I use (some are on Ubuntu, some with Windows), also on my Android phones.
Using dig #mydns subdomain.mydomain.com return the local IP so I assume that the Bind configuration is OK, but dig subdomain.mydomain.com (or ping) doesn't always return the proper IP. I also tried to disable forwarders for the subdomain like this :
zone "mydomain.com" {
type master;
file "/etc/bind/db.mydomain";
forwarders {};
};
I flushed the DNS cache of my computers and there is no other DNS server on my network so I don't understand how this can happen. I also tried to log requests on the Bind server and I don't see requests with the external IP address returned (only those with the internal). So where did these requests go through ?
I finally found out what the problem was : my custom DHCP/DNS server was configured for IPv4 only, but my ISP box also provide IPv6 capabilities, so all the DNS requests from the devices on the network where sent on both protocols and half of the time, the request was answered by the ISP box instead of my custom DNS.
I disabled IPv6 for now and the problem is gone. I'll configure it for my custom server later.

Subdomain points to public IP, when used internal it doesn't load, only externally, what can be done?

We created a subdomain for a website hosted in our internal server. In GoDaddy we set up the subdomain to point to the public IP address, but when we try to access the link internally it doesn't load (because it needs the internal IP to access it) What can be done in this case?
You obviously need to provide different information to internal DNS clients than those publicly available to the world. For that you need to have internal DNS server or DNS proxy that will respond with internal IP address, and your internal clients need to be configured to use that internal DNS server. Specific steps to achieve all this depend on your environment.
The other option is to create another DNS record (for example subdomain-internal.example.com) that will point to private IP address, and use that from internal network (of course, you might need to configure your webserver to respond to that hostname also)

Accessing WAMP server from a different network

I was trying to setup WAMP server on my machine . Am able to access the localhost from the same PC or remotely from other devices in the same network .
However I would like to know how can I access it from a different network ?
Check the port 80 forwarding on your router. Forward port 80 of that particular machine/server to your router. That server should have a permanent local IP like 192.168.1.* or 192.168.2.*, etc whose port 80 is forwarded to the public IP of your router. This provides access to your server/machine with the set IP from outside your network!
For router settings, open a browser, in the location bar, type http://192.168.1.1 or whatever your router manual says it to be. You will need the default user/pass to login.
In order to have a permanent access to your home server with a domain, You need to get a permanent public IP for your network from your Internet service provider in order to assign a domain name to it.

Access to a site on localhost from remote

I use to develop my project on my localhost, on apache in ubuntu machine.
Sometimes i need to show progress to my costumer.
Is it possible to access to localhost from remote machine?
You can use a service that provides a tunnel to your local service, such as localtunnel, pagekite or ngrok. These services simplify setting up remote demos, mobile testing and some provide request inspection as well.
I find ngrok useful because it provides a https address, which is needed to test things like webcam access.
Terms used in this answer:
Host = machine with site on it
Client = machine you are trying to access the host from
If the host and client are on the same network, you can access the host from the client by entering
http://(hostname or ip address)
in your client's browser. If the site is not running on port 80 (for http) or port 443 (for https), add the post as so (this example is for if your server is on 8080, a common alternate port):
http://(hostname or ip address):8080
If the host and client are not on the same network, and you need to reach across the internet from the client to see the host, you will need to make your host available on the internet for the client to access.
This can be extremely dangerous for your information security if you're not sure what you're doing and I'd recommend getting a cheap-o hosting account (can get them for like $10/month at places like 1:1 hosting).
There are many methods to do this - the difference is security, easiness of the configuration and cost of the solution.
Following I am typing some methods with some analyses
Port Forwarding (with Dynamic DNS and SSL encryption)
This requires router configuration (to forward your routers public port to loclhoat port), however this requires you to have fixed ip address. In case your ip address is not fixed (in most cases) you need to use Dynamic DNS services to be able to use domain name instead ip address (there are lot of available free services). Here we still have security question open. To solve security question i.e. setup ssl certificate we can use Let’s Encrypt service ( https://letsencrypt.org/ ) to get free certificate, however we should configure local server to use the certificate or we should setup reverse proxy (in most cases nginx or apache) and configure proxy to use certificate.
Conclusion – Hard to setup if we want to have secure connection (can be done for free)
VPN
For this scenario we should use VPN services. We should connect our local machine to VPN then in other side we should connect our client's machine to VPN that will allow us to access to localhost by local IP address. We can set up our own VPN server however this requires knowledge to do it right.
Conclusion – Easy, Paid, Secure, Bad User Experience (connecting to VPN every time you need to connect to localhost)
Tunneling
For this scenario we can use free tunneling services (i.e. https://tunnelin.com/). The process is very straight forward i.e. Register a User, Connect your device to service (by running one line command on device), use Web interface to open/close secure tunnels to the device.
Conclusion – Free, Secure, Easy
Yes, if you have a public and static IP. Usually, ISPs offer static ips during a session (i.e. until you disconnect and connect again)

Broadcast your internet ip

i want to do something like broadcasting my application over internet using my ip.
I have a static IP say a.b.c.d and want to deploy some application say a war file in tomcat on port 8080 so that some remote friend of mine who is not on network can access it over internet using http://a.b.c.d:8080 in browser. i have windows vista/XP installed on my system.
thanks, hope i made the question clear i am still confused with it :(
If you truly have a static IP, and your computer is not behind a NAT box or firewall, then if a.b.c.d is that static address, what you've described will simply work. If you do have a firewall, you have to add an exception to allow requests in. If you've got a NAT box, which you would use to share that static IP among computers, then you need to set the NAT box up to forward requests on that one port to your computer. FInally, if you want a.b.c.d to be a name, rather than numbers, then you need to register a domain name with a registrar like GoDaddy.com and pay some money.
You can use dyndns and set up a domain for your friend to access. www.dyndns.com
Dynamic DNS service allows you to point a hostname to a dynamic or static IP address or URL.

Resources