Linux Pointing Domain to Home Server?

Discussion in 'Software' started by AZDiablo, 7 Jan 2011.

  1. AZDiablo

    AZDiablo What's a Dremel?

    Joined:
    29 Dec 2010
    Posts:
    6
    Likes Received:
    0
    I have been searching for the answer to this question all over the web and think I am really close. :wallbash:

    I have a LAMP server running Centos 5. I have a domain name superstave.com. My server I hanging out on my network behind a router. In the router I have done single port forwarding to the static IP address I assigned to the LAMP server. On the router it has drop downs on the left that say FTP, HTTP, or etc. I chose the first one FTP and it assigned port 21 to the address I entered. In the instructions I found it said to also open port 80 which I did in the custom section of port forwarding.

    The LAMP server is called server5. I looked up my IP address via some website and it told me the address going to the modem. My domain is registered with 1and1.com. On the domain website I have directed the domain name to my IP address.

    So the reason I am posting is that I cannot connect my server using the domain name. I can connect using the IP address I assigned on the network.

    In the hosts file the static IP of the server is 192.168.1.121 server5.superstave.com server5
     
  2. RichCreedy

    RichCreedy Hey What Who

    Joined:
    24 Apr 2009
    Posts:
    4,699
    Likes Received:
    172
    are you using home broadband or business broadband?

    if home broadband you wont have a static ip address, so would need to use a service like dyndns.org . your router should have a setting for using dyndns or other service.

    you need to register with them, then use the details you got from them on the router.

    you can then point your domain name at the dyndns name you set up, or just use the dyndns domain name.

    edit: forgot to mention port 80 is the standard http port
     
    Last edited: 8 Jan 2011
  3. AZDiablo

    AZDiablo What's a Dremel?

    Joined:
    29 Dec 2010
    Posts:
    6
    Likes Received:
    0
    I have changed my router to use the static ip address.

    Here is the information for domain host company and my Linux server.

    DNS Check Result

    Domain name superstave.com
    IP address (A record) 98.165.xxx.xxx
    Name server 1 ns51.1and1.com
    Name server 2 ns52.1and1.com
    Mail server 1 mx00.1and1.com, 10
    Mail server 2 mx01.1and1.com, 10

    Router single port forwarding:
    Name: Server5
    External Port: 80
    Internal port: 80
    IP address: 192.168.1.xxx

    Linux ifconfig info:
    eth0 Link encap:Ethernet HWaddr 00:E0:18:79:33:5D
    inet addr:192.168.1.xxx Bcast:192.168.1.255 Mask:255.255.255.0
    inet6 addr: fe80::2e0:18ff:fe79:335d/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:2902 errors:0 dropped:0 overruns:0 frame:0
    TX packets:2218 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:366829 (358.2 KiB) TX bytes:613768 (599.3 KiB)
    Interrupt:193 Base address:0x8000

    lo Link encap:Local Loopback
    inet addr:127.0.0.1 Mask:255.0.0.0
    inet6 addr: ::1/128 Scope:Host
    UP LOOPBACK RUNNING MTU:16436 Metric:1
    RX packets:8 errors:0 dropped:0 overruns:0 frame:0
    TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:560 (560.0 b) TX bytes:560 (560.0 b)

    I can login to Webmin I enter the server IP address: https://192.168.1.xxx:10000

    I cannot access Webmin using the domain name. server5.superstave.com or superstave.com
     
  4. Zoon

    Zoon Hunting Wabbits since the 80s

    Joined:
    12 Mar 2001
    Posts:
    5,497
    Likes Received:
    630
    Are you trying to connect within your LAN to server5.superstave.com or do you want users on the internet to do this?

    If you just want your LAN, and only your LAN to do this, and its only one or two PCs, the way to do it is to edit c:\Windows\System32\drivers\etc\hosts on those PCs and add in the hostname manually.

    If you want it to be accessible over the internet, you will need a static IP from your ISP, and you may set up an A record in your domain control panel (it'll be called something like "custom DNS" probably) to point to your static public IP, as well as doing the LAN setup above.

    Your LAN PCs cannot loop out of your router and back in again, as you'll only have one static IP, and NAT will get confused, meaning you cannot connect to your public IP for the server from within your LAN.

    The reason I do not suggest you put 192.168.x.x addresses on your domain control panel, is that 1. 1&1 shouldn't allow it anyway and 2. I'm pretty sure its not technically permitted under the RFC for domain names.
     
  5. Chairboy

    Chairboy I want something good to die for...

    Joined:
    10 Jun 2004
    Posts:
    1,773
    Likes Received:
    112
    you need to create an A reord entry for server5.superstave.com.

    1and1 only add www. and smtp. by default. Any others you will need to add manually
     
  6. yakyb

    yakyb i hate the person above me

    Joined:
    10 Oct 2006
    Posts:
    2,064
    Likes Received:
    36
    its not completely clear what you are trying to acheive here, what is your specific aim?
     
  7. dinoscothern

    dinoscothern Minimodder

    Joined:
    16 Aug 2010
    Posts:
    132
    Likes Received:
    0
    Suggestions:
    (Apologies if you know this already)

    Assuming you have one external ip.
    1) Find out your external ip (use a service like whats my ip)
    2) Confirm that its the same as what you have changed www.superstave.com etc
    3) Confirm that your internet router responds to external pings (may need enabling).
    4) Check that port forwarding is setup on your internet router so that incoming external connections are correctly forwarded (probably 80,443 and 21) to the internal server.
    5) Setup internal server services you want to run (apache may need setting up to respond to www.superstave.com etc)

    6) Test:
    6a) Ping local server ip
    6b) Ping internet router external ip (this should work if you have allowed it)
    6c) Use telnet or nc to check connectivity for port 80/443/21 on
    local server ip and internet router external ip.
    If that works then your basic config is ok.
    6d) Now try from somewhere else (ask a friend). If its not working then I guess your isp is blocking the ports. You may need to contact them (they may have a faq for it).

    If you have paid for a static ip, then you wont have to update your dns using a dydns tool.
     

Share This Page