should i change localhost ? [SOLVED]

Got problems with your B2 or B3? Share and get helped!
Post Reply
zander
Posts: 141
Joined: 01 Jan 2009, 23:16
Location: las vegas, nv, usa
Contact:

should i change localhost ? [SOLVED]

Post by zander » 09 Jan 2013, 02:25

hi,

i have my A record pointing to b2.<mydomain>.com

should i change my hostname to b2.<mydomain>.com?

and can i do this using the web interface setup page?

i think the answer is yes but i want to be sure.

thank you.
Last edited by zander on 11 Jan 2013, 11:20, edited 1 time in total.
~alonzo...

Gordon
Posts: 1390
Joined: 10 Aug 2011, 03:18

Re: should i change localhost ?

Post by Gordon » 09 Jan 2013, 03:44

Yes you can if you want to and using the web interface is definitely a good place to start.

You should note though that changing the hostname does not also change how every other instance or service publishes itself. My advise is that you stick to the local domain identity that you use on your LAN environment and enter the public name in the corresponding conf files of the services you like to publish (SMTP, FTP, etc.). Also note that if you want to use any SSL encryption that the certificate should reflect the internet name for that service (they don't have to be the same).

zander
Posts: 141
Joined: 01 Jan 2009, 23:16
Location: las vegas, nv, usa
Contact:

Re: should i change localhost ?

Post by zander » 09 Jan 2013, 17:51

hi,

thank you for the reply.

i tried to set b2.<mydomain>.com using the web interface but it was rejected because of the '.''s.

subsequently then i should make the change in my .conf files such as http.conf, ssh.conf, and ftp.conf?

the reason i have these questions is a few days ago re-installed the os on my b2. now i can't reach the /web/index.html by typing in http://<mydomain>.com. this is why i have been wondering about changing localhost to my domain.

i had to delete and replace the rsa key for my .ssh trusted host file with the new install's rsa key so i could ssh to the b2.

there are a few other issues but i might should verify they still exist and start a new thread for them.

also, how do i mark a thread solved? :)

thank you again.

please advise.
~alonzo...

Gordon
Posts: 1390
Joined: 10 Aug 2011, 03:18

Re: should i change localhost ?

Post by Gordon » 10 Jan 2013, 06:52

I can't tell whether it is correct that the web interface doesn't accept the dots in your hostname. I have a B3 myself and it does have a full spec domain name in there (I may have changed that from the commandline though - I really can't remember).

The issue you're having sounds more like a DNS and/or routing issue. It is likely that you're using an ISP router to connect to the internet and by trying to connect to your web interface are in fact looking at the internet side of your router trying to forward the requests back to the LAN side and the B2. As a rule of thumb you cannot pass the same router twice, so this is not possible.

The better solution in this case is to add a firewall rule to your router that says that if you're on the LAN side and want to reach the public address that is the internet side of your router that it should forward to the B2. Whether you can add such a rule depends on the router - note that if you have a cascade of you -> B2 -> ISP_router than you should add this rule to the B2.

As an alternative you can add a DNS entry to your DNS caching service, that overrides the official DNS response for your domain.

zander
Posts: 141
Joined: 01 Jan 2009, 23:16
Location: las vegas, nv, usa
Contact:

Re: should i change localhost ?

Post by zander » 10 Jan 2013, 17:32

hi gordon,

thank you for staying with me on this one.

i have the b2 configured as "Router+Firewall+Server". WAN setting is static ip address set according to what was given by my isp in 2010.

LAN is set to use static ip address with DNS service and DHCP server showing "ON" (in web interface).

on the LAN side of the network i have defeated the router in my WRT54GL wireless router by plugging the LAN of the b2 into the WRT54GL on the switch side of the ports (bypassing the wireless WRT54GL router hardware). switching the WRT54GL DHCP server off, setting the router address to the same as the static ip address given for the server by my isp. and generally ignoring the internet settings during the WRT54GL setup.

i have considered running netconfig by ssh into b2 as my personal account then going to root with su or running the command prefixed with sudo.

EDIT:going to root with su() is covered in the wiki.
but attempts to sudo() was rejected with "command unknown" and su rejected with "authorization failed" although i tried several times with what i know to be the new admin password set just after reinstall of the os which i know works for web interface login as admin.

i don't know if this helps or make things more confusing but this is where i am at.

please advise if possible.

thank you.
~alonzo...

Gordon
Posts: 1390
Joined: 10 Aug 2011, 03:18

Re: should i change localhost ?

Post by Gordon » 11 Jan 2013, 02:47

Okay, so essentially what you're saying is that the ISP router is out of the equation. I'm a bit confused about this particular line though:
...setting the router address to the same as the static ip address given for the server by my isp
Actually.... I'm a lot confused about this...

If the B2 is acting as your connection towards the internet than the default route for all devices on your LAN should be the LAN side address of your B2. This should allow you to reach any address outside your LAN, including the WAN side address of your B2. Being on the LAN side, no firewall rules apply in this case. Except for the possibility that the DHCP server in the ISP router, that you are using as a switch, may in fact not be disabled, this should run straight out of the box.

And you're right. Sudo is not part of the default installation. You can of course add it if you like.

zander
Posts: 141
Joined: 01 Jan 2009, 23:16
Location: las vegas, nv, usa
Contact:

Re: should i change localhost ?

Post by zander » 11 Jan 2013, 03:01

hi,

and thank you for those remarks.

i have solved the issue of connecting to outside web sites on linux machines inside my network. it required a re-configuration of my WRT54GL router. so all my computers can now reach all websites outside. :)

the issue now is does b2.localhost need to be changed to b2.<mydomain> for my dns to correctly point to the /web directory where the default b2 homepage is? perhaps you know this right away.

my next step should be to try and note the changes i have made to the router. NOTE the LAN output from the b2 ~is~ connected to the switch side of the WRT54GL hardware ports by-passing the router hardware altogether. i feel this is valid because that is how the connection is shown in the diagram for Scenario 5. <+++(a HUGE step forward!)
~alonzo...

zander
Posts: 141
Joined: 01 Jan 2009, 23:16
Location: las vegas, nv, usa
Contact:

Re: should i change localhost ?

Post by zander » 11 Jan 2013, 04:52

and the answer is b2.localhost does not need to be changed!

it took some time for the dns update to propagate but all is good now. 8)

how do i mark a thread solved please?
~alonzo...

Gordon
Posts: 1390
Joined: 10 Aug 2011, 03:18

Re: should i change localhost ? [SOLVED]

Post by Gordon » 11 Jan 2013, 13:21

Glad to see you got your issues resolved.

zander
Posts: 141
Joined: 01 Jan 2009, 23:16
Location: las vegas, nv, usa
Contact:

Re: should i change localhost ? [SOLVED]

Post by zander » 11 Jan 2013, 14:55

i am very pleased to have things under control with a sense of understanding it also.


and indeed
...setting the router address to the same as the static ip address given for the server by my isp
was unnesecarry and should not be done to get things working properly.

the only issue now is that i cannot login to the WRT54GL admin panel to put the correct settings in my notebook.

it looks like i will have to start over by resetting the WRT54GL, noting the changes as i make as i make them, then hoping all is okay when i save the final configuration and restart the linksys in router mode.

i suppose it's all good exercise. :roll: :lol:
~alonzo...

Post Reply