Visit local website

Issues related to configuring your network
vicwoods
Posts: 11
Joined: 2018/01/22 14:30:04

Visit local website

Post by vicwoods » 2018/01/22 14:38:59

Hi guys!

We have to do a little troubleshoot exercise for a school project.
But I i'm stuck. I have a client (fedora 27) a server (dhcp & dns) and a router I'm supposed to be able to visit the local website but can't the website is http://www.linuxlab.lan .


/etc/rosolv.conf

# Generated by NetworkManager
search home
nameserver 10.0.2.3


/etc/hosts
172.20.0.101 workstation workstation
10.0.2.15 linuxlab.lan linuxlab.lan
127.0.0.1 server server
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost3.localdomain6

User avatar
TrevorH
Forum Moderator
Posts: 23678
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Visit local website

Post by TrevorH » 2018/01/22 14:44:07

10.0.2.15 linuxlab.lan linuxlab.lan
Doesn't list www.linuxlab.lan in that list so unless it's known by your DNS server, it won't be found.
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

vicwoods
Posts: 11
Joined: 2018/01/22 14:30:04

Re: Visit local website

Post by vicwoods » 2018/01/22 14:54:18

So i should remove the http://www.linuxlab.lan?

When i try curl www.linuxlab.lan in my workstation i get:
could not resolve host: www.linuxlab.lan; Name or service not know

I have no idea how i should fix it.. :(

User avatar
TrevorH
Forum Moderator
Posts: 23678
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Visit local website

Post by TrevorH » 2018/01/22 15:08:54

The issue is that www.linuxlab.lan is not the same thing as linuxlab.lan. You either need to change the url you visit to match the hosts file entry or you need to add or amend the hosts file entry to include the www. version of it.
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

tunk
Posts: 424
Joined: 2017/02/22 15:08:17

Re: Visit local website

Post by tunk » 2018/01/22 15:12:02

Can you ping 10.0.2.15?
I guess that Trevor ment this in /etc/hosts (oops, didn't see Trevor's post):

Code: Select all

10.0.2.15 www.linuxlab.lan www.linuxlab.lan  

vicwoods
Posts: 11
Joined: 2018/01/22 14:30:04

Re: Visit local website

Post by vicwoods » 2018/01/22 15:20:31

tunk wrote:Can you ping 10.0.2.15?
I guess that Trevor ment this in /etc/hosts (oops, didn't see Trevor's post):

Code: Select all

10.0.2.15 www.linuxlab.lan www.linuxlab.lan  

Yes I can ping 10.0.2.15 I made the change but still can't get to www.linuxlab.lan
Last edited by vicwoods on 2018/01/22 15:21:30, edited 1 time in total.

pjsr2
Posts: 343
Joined: 2014/03/27 20:11:07

Re: Visit local website

Post by pjsr2 » 2018/01/22 15:21:06

I guess that Trevor ment this in /etc/hosts (oops, didn't see Trevor's post):

Code: Select all

10.0.2.15 www.linuxlab.lan www.linuxlab.lan
There is no need to write the host name twice in the /etc/hosts file. Each line is simply the IP-address followed by the host name, optionally followed by a list of alias names. So in case "www.linuxlab.lan" and "linuxlab.lan" refer to the same host, then you can write:

Code: Select all

10.0.2.15 linuxlab.lan www.linuxlab.lan

vicwoods
Posts: 11
Joined: 2018/01/22 14:30:04

Re: Visit local website

Post by vicwoods » 2018/01/22 15:24:32

Also The workstation gets its ip from DHCP so did i do that the right way?

tunk
Posts: 424
Joined: 2017/02/22 15:08:17

Re: Visit local website

Post by tunk » 2018/01/22 15:45:04

Can you run these as root on your client:

Code: Select all

nmap 10.0.2.15
nmap www.linuxlab.lan
Port 80 should be open. If not, check firewalls and that there's a web-server (apache?) running on your server.

vicwoods
Posts: 11
Joined: 2018/01/22 14:30:04

Re: Visit local website

Post by vicwoods » 2018/01/22 15:55:21

tunk wrote:Can you run these as root on your client:

Code: Select all

nmap 10.0.2.15
nmap www.linuxlab.lan
Port 80 should be open. If not, check firewalls and that there's a web-server (apache?) running on your server.
when trying to run "nmap 10.0.2.15" it says "bash: nmap: command not found"

The I have ports 80 and 443 open on my server. It has apache

EDIT: I've tried "yum install nmap" but it seems to fail

Post Reply