title: hosting - how to get domain name for my website from home?
body: <p>i want to set up a server for hosting a static website (html/css/javascript), so i install RHEL 7 on my computer , and i install apache2.4.6 , also i forward the ports 80 (for apache ) and 22 (for ssh), after i set up a dns server from <a href="https://linuxconfig.org/how-to-setup-a-named-dns-service-on-redhat-7-linux-server" rel="nofollow noreferrer">this tutorial</a>  , and when i test the dns server with :</p>
  
  <pre><code>dig @192.168.1.110 www.example.com
  </code></pre>
  
  <p>i get this output :</p>
  
  <pre><code>; &lt;&lt;&gt;&gt; DiG 9.9.4-RedHat-9.9.4-51.el7_4.2 &lt;&lt;&gt;&gt; @192.168.1.110 www.example.com
  ; (1 server found)
  ;; global options: +cmd
  ;; Got answer:
  ;; -&gt;&gt;HEADER&lt;&lt;- opcode: QUERY, status: NOERROR, id: 46518
  ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 1
  
  ;; OPT PSEUDOSECTION:
  ; EDNS: version: 0, flags:; udp: 4096
  ;; QUESTION SECTION:
  ;www.example.com.       IN  A
  
  ;; ANSWER SECTION:
  www.example.com.    10800   IN  A   1.1.1.1
  
  ;; AUTHORITY SECTION:
  example.com.        10800   IN  NS  ns2.rhel7.local.
  example.com.        10800   IN  NS  ns1.rhel7.local.
  
  ;; Query time: 31 msec
  ;; SERVER: 192.168.1.110#53(192.168.1.110)
  ;; WHEN: Fri Mar 02 18:48:12 WET 2018
  ;; MSG SIZE  rcvd: 107
  </code></pre>
  
  <p>so i think all is good , after i create in <strong>/var/www/</strong> one directory called <strong>sites</strong> (where i gnna past all my website ) and i copy tow website ( directories ) inside this directory : <strong>site1</strong> and <strong>utopic_flowers</strong>.
  now i can access to my website from another computer (outside my network) with this syntax :</p>
  
  <blockquote>
    <p>public_ip_address/sites/site1/</p>
  </blockquote>
  
  <p>and </p>
  
  <blockquote>
    <p>public_ip_address/sites/utopic_flowers/</p>
  </blockquote>
  
  <p>now how can i set a domain name for those websites , where i can access to it by this syntax :</p>
  
  <blockquote>
    <p>www.site1.com</p>
  </blockquote>
  
  <p>and</p>
  
  <blockquote>
    <p>www.utopic_flowers.com</p>
  </blockquote>
  
  <p>thank you in advance.</p>