LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 09-04-2011, 08:22 AM   #1
Brian Murphy
LQ Newbie
 
Registered: Feb 2011
Location: Woodland, Washington
Posts: 17

Rep: Reputation: 0
Do I need a DNS Server?


I have a home network with 2 Ubuntu LAMPS Servers 11.04, 1 Ubuntu 11.04 with gui. I am playing / learning PHP and Mysql, as well as server administration.

Currently I have to type in "192.168.0.2/firstphp" to get to the first php/html page I wrote. I am trying to set up my server on static ip 192.168.0.2 so I can type "myphpsite,com/firstphp" to view that page.

I have read on Bind9 in the Ubuntu Server Guide. I am unsure that it is the right way. I do not want my boxes on the net, only local.

Thank You,
 
Old 09-04-2011, 08:49 AM   #2
lydiaXr
LQ Newbie
 
Registered: Jun 2011
Location: London
Distribution: FreeBSD, Ubuntu, Fedora
Posts: 15

Rep: Reputation: Disabled
You don't need a DNS server to do that. You can modify your /etc/hosts file to include a line like the following:

127.0.0.1 myphpsite.com


That will point requests for myphpsite.com to your local Apache install. If you wish to get to an Apache install on a different box, include something like this:

192.168.0.2 myphpsite.com
 
Old 09-04-2011, 09:08 AM   #3
Brian Murphy
LQ Newbie
 
Registered: Feb 2011
Location: Woodland, Washington
Posts: 17

Original Poster
Rep: Reputation: 0
I tried that. I have a problem. There is an actual site on the net, "myphpsite.com" my web browser tries to go there. I will reconfigure apache and hosts file to a name not on the net and try it.
 
Old 09-04-2011, 09:16 AM   #4
lydiaXr
LQ Newbie
 
Registered: Jun 2011
Location: London
Distribution: FreeBSD, Ubuntu, Fedora
Posts: 15

Rep: Reputation: Disabled
Hm, works just fine for me and lots of others.

What distro? What are the contents of /etc/resolv.conf? Check /etc/host.conf to see if hosts is listed first or bind in the 'order' line.
 
Old 09-04-2011, 09:32 AM   #5
Brian Murphy
LQ Newbie
 
Registered: Feb 2011
Location: Woodland, Washington
Posts: 17

Original Poster
Rep: Reputation: 0
Ok... New site created... "bphpsite.com". /etc/hosts updated "127.0.0.1 bphpsite.com" "192.168.0.2 bphpsite.com"

When I type "bphpsite.com/firstphp" into my internet explorer bar, it takes me to my ISP search engine.

I did neglect to mention I am using a laptop, windows 7, connected wirelessly to view my webpages.... Internet Explorer (64 Bit).
 
Old 09-04-2011, 09:42 AM   #6
Brian Murphy
LQ Newbie
 
Registered: Feb 2011
Location: Woodland, Washington
Posts: 17

Original Poster
Rep: Reputation: 0
/etc/resolv.conf

domain domain_not_set.invalid
search domain_not_set.invalid
nameserver 192.168.0.1
nameserver 216.165.129.158

/etc/host.conf
order host,bind
multi on

Thank You for your help
 
Old 09-04-2011, 09:43 AM   #7
Brian Murphy
LQ Newbie
 
Registered: Feb 2011
Location: Woodland, Washington
Posts: 17

Original Poster
Rep: Reputation: 0
Distro is Ubuntu 11.04
 
Old 09-04-2011, 10:08 AM   #8
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,694

Rep: Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894
For a windows PC to resolve IP addresses to URLs you need to add an entry it it's lmhosts file. lmhosts is the equiv of /etc/hosts.
 
Old 09-04-2011, 10:25 AM   #9
Brian Murphy
LQ Newbie
 
Registered: Feb 2011
Location: Woodland, Washington
Posts: 17

Original Poster
Rep: Reputation: 0
Do I understand right? If I am using my windows 7 laptop as a client, to access my server, I have to update my Imhosts file on the laptop?
 
Old 09-04-2011, 10:39 AM   #10
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,694

Rep: Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894
Yes, so the laptop will be able to resolve the servers IP address from the URL bphpsite.com.
 
Old 09-06-2011, 11:37 PM   #11
Brian Murphy
LQ Newbie
 
Registered: Feb 2011
Location: Woodland, Washington
Posts: 17

Original Poster
Rep: Reputation: 0
Been busy with life, now back to my problem.

Afraid to mess with my windows 7 laptop.
I moved to Ubuntu 11.04 desktop, IP address192.168.0.25, assigned DHCP from DSL modem/router.
Added "192.168.0.2 bphpsite.com",without the quotes......
Typed "bphpsite.com/firstphp" into browser address bar..... still went to the net, not to my LAMPS box.
Typed "192.168.0.2/firstphp" into browser address bar.... went to LAMPS box....

My resolv.conf and host.conf are in previous posts....
 
Old 09-09-2011, 08:34 PM   #12
Brian Murphy
LQ Newbie
 
Registered: Feb 2011
Location: Woodland, Washington
Posts: 17

Original Poster
Rep: Reputation: 0
Ok... I figured my problem out. It was me!

I did something wrong in Apache. I tried typing "192.168.0.2/bphpsite/firstphp" into my web browser. It displayed my page!

I want to thank everyone that tried to help. It was nota wasted effort, as it increased my knowledge.

Thanks!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to configure another dns server to combine use with primary current dns server. hocheetiong Linux - Newbie 1 05-29-2008 06:57 PM
LXer: Find out DNS Server Version With DNS Server Fingerprinting Tool LXer Syndicated Linux News 0 12-21-2007 05:30 PM
LXer: Find out DNS Server Version With DNS Server Fingeprinting Tool LXer Syndicated Linux News 0 12-21-2007 04:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:12 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration