Hi Everyone
I was wondering if following is possible:
I have installed an Apache2 server, MySQL, PHPmyAdmin and vsftp(i think its called)
I can connect to the FTP, PHP and mySQl using the IP address, I see the default index page of the Apache server when using the IP address in the Browser.
If I try the same with the newly set hostname instead of IP, it fails. My router does see the Raspberry and displays its name and IP correctly.
is it possible to get this to work?
im trying to make the FTP server accessible from the world. its not really necessary via hostname since my router will do the Dynamic DNS part and will Portforward to the raspberry... (or I hope at least that this will work. fairly new to this networking)
Great full for any input!
-Atari
Hostname instead of IP
"This isnt where I parked my Car" - Albert Einstein - Zürich - 2008
Re: Hostname instead of IP
How did you set up the hostname? Can you paste the output ofATARI wrote:If I try the same with the newly set hostname instead of IP, it fails.
Code: Select all
cat /etc/hosts
Code: Select all
cat /etc/hostname
Re: Hostname instead of IP
Hi!
the Output reads following
and
thanks for the fast reply
the Output reads following
Code: Select all
127.0.0.1 localhost
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
127.0.1.1 ethftp
Code: Select all
ethftp
"This isnt where I parked my Car" - Albert Einstein - Zürich - 2008
Re: Hostname instead of IP
Are you using IPv6 or why are those lines uncommented (normally they are commented out)? Did you reboot (restarting the network should be enough) after you made the changes? Was it working before you changed it?
Re: Hostname instead of IP
I am not really sure why its set to IPv6, its not by my choice so I could change it to IPv4 if you can tell me how that works.
yes the network and the PI was restarted
no it never worked with hostname, although I haven't tried it with the default name
yes the network and the PI was restarted
no it never worked with hostname, although I haven't tried it with the default name
"This isnt where I parked my Car" - Albert Einstein - Zürich - 2008
Re: Hostname instead of IP
Maybe the default settings have been changed (on my RPi they are commented out), don't think that's the issue here anyway.ATARI wrote:I am not really sure why its set to IPv6, its not by my choice so I could change it to IPv4 if you can tell me how that works.
yes the network and the PI was restarted
no it never worked with hostname, although I haven't tried it with the default name
Just to make sure - is the device you are trying to connect from connected to the same local network as the RPi?
Re: Hostname instead of IP
they are.
my PC's IP is 192.168.0.199
and the Pi's is 192.168.0.198
I really dont know what wrong
my PC's IP is 192.168.0.199
and the Pi's is 192.168.0.198
I really dont know what wrong
"This isnt where I parked my Car" - Albert Einstein - Zürich - 2008
Re: Hostname instead of IP
What OS is the PC running? Can you try this command (works on Linux, I think Windows and Mac I don't know)ATARI wrote:they are.
my PC's IP is 192.168.0.199
and the Pi's is 192.168.0.198
I really dont know what wrong
Code: Select all
arp -a
Re: Hostname instead of IP
this is the output on said command
Code: Select all
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\Kim9>arp -a
Interface: 192.168.0.199 --- 0xb
Internet Address Physical Address Type
192.168.0.1 00-18-e7-ce-43-98 dynamic
192.168.0.197 00-1f-c6-1b-ee-ac dynamic
192.168.0.255 ff-ff-ff-ff-ff-ff static
224.0.0.22 01-00-5e-00-00-16 static
224.0.0.251 01-00-5e-00-00-fb static
224.0.0.252 01-00-5e-00-00-fc static
239.255.255.250 01-00-5e-7f-ff-fa static
255.255.255.255 ff-ff-ff-ff-ff-ff static
Interface: 25.125.210.207 --- 0x11
Internet Address Physical Address Type
25.0.0.1 7a-79-19-00-00-01 dynamic
25.45.17.222 7a-79-19-2d-11-de dynamic
25.129.7.57 7a-79-19-81-07-39 dynamic
25.255.255.255 ff-ff-ff-ff-ff-ff static
224.0.0.22 01-00-5e-00-00-16 static
224.0.0.251 01-00-5e-00-00-fb static
224.0.0.252 01-00-5e-00-00-fc static
239.255.255.250 01-00-5e-7f-ff-fa static
255.255.255.255 ff-ff-ff-ff-ff-ff static
C:\Users\Kim9>
"This isnt where I parked my Car" - Albert Einstein - Zürich - 2008
-
- Posts: 7689
- Joined: Sat Jan 12, 2013 3:01 am
- Location: Grants Pass, OR, USA
- Contact: Website
Re: Hostname instead of IP
I think you have to install winbind. I haven't tried it myself
see this:
http://www.raspberrypi.org/phpBB3/viewt ... 66&t=25693
see this:
http://www.raspberrypi.org/phpBB3/viewt ... 66&t=25693
Unless specified otherwise my response is based on the latest and fully updated RPiOS Buster w/ Desktop OS.
Re: Hostname instead of IP
How are you expecting the PC to resolve the hostname of the PI into its IP address ?
PeteO
PeteO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson
Re: Hostname instead of IP
Winbind shouldn't be necessary for this.ATARI wrote:this is the output on said command
Code: Select all
Microsoft Windows [Version 6.1.7600] Copyright (c) 2009 Microsoft Corporation. All rights reserved. C:\Users\Kim9>arp -a Interface: 192.168.0.199 --- 0xb Internet Address Physical Address Type 192.168.0.1 00-18-e7-ce-43-98 dynamic 192.168.0.197 00-1f-c6-1b-ee-ac dynamic 192.168.0.255 ff-ff-ff-ff-ff-ff static 224.0.0.22 01-00-5e-00-00-16 static 224.0.0.251 01-00-5e-00-00-fb static 224.0.0.252 01-00-5e-00-00-fc static 239.255.255.250 01-00-5e-7f-ff-fa static 255.255.255.255 ff-ff-ff-ff-ff-ff static Interface: 25.125.210.207 --- 0x11 Internet Address Physical Address Type 25.0.0.1 7a-79-19-00-00-01 dynamic 25.45.17.222 7a-79-19-2d-11-de dynamic 25.129.7.57 7a-79-19-81-07-39 dynamic 25.255.255.255 ff-ff-ff-ff-ff-ff static 224.0.0.22 01-00-5e-00-00-16 static 224.0.0.251 01-00-5e-00-00-fb static 224.0.0.252 01-00-5e-00-00-fc static 239.255.255.250 01-00-5e-7f-ff-fa static 255.255.255.255 ff-ff-ff-ff-ff-ff static C:\Users\Kim9>
"arp -a" works differently on Windows then apparently. What you could do as a workaround is add the hostname manually to the host file on the Windows computer:
Code: Select all
192.168.0.198 ethftp
Re: Hostname instead of IP
arp is not the problem here.....
arp translates ip addresses into MAC addresses. The problem here (as far as I read it) is a lack of a mechanism to preform host name to IP address translation.
PeterO
arp translates ip addresses into MAC addresses. The problem here (as far as I read it) is a lack of a mechanism to preform host name to IP address translation.
PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson
Re: Hostname instead of IP
I know that it's not the problem, "arp -a" also shows the hostnames of the devices on the local network (on Linux), I just wanted to see if it was able to resolve it. I guess there's some DNS problem, but I don't really know how to investigate that further. Setting the RPi's host on the PC client will work though.PeterO wrote:arp is not the problem here.....
arp translates ip addresses into MAC addresses. The problem here (as far as I read it) is a lack of a mechanism to preform host name to IP address translation.
PeterO
Re: Hostname instead of IP
Yes well this doesnt work either.
Im starting to think my router is the problem, because if I set my Router to lookup the Dyndns entry it allways says: connected.
if I ftp to the Dyndns domain e.g. ethftp@dyndns.org it resolvers the external IP of the router correctly but then does not let me access the PI for witch I port forwarded correctly (on port 21 to the internal IP of the RPI)
Im starting to think my router is the problem, because if I set my Router to lookup the Dyndns entry it allways says: connected.
if I ftp to the Dyndns domain e.g. ethftp@dyndns.org it resolvers the external IP of the router correctly but then does not let me access the PI for witch I port forwarded correctly (on port 21 to the internal IP of the RPI)
"This isnt where I parked my Car" - Albert Einstein - Zürich - 2008
Re: Hostname instead of IP
Many routers don't allow loopback connections, so if you are connecting from the same local network through dyndns to the server it might not be possible. You could try an online port checker to see if the port is open. This is probably a different issue anyway.ATARI wrote:Yes well this doesnt work either.
Im starting to think my router is the problem, because if I set my Router to lookup the Dyndns entry it allways says: connected.
if I ftp to the Dyndns domain e.g. ethftp@dyndns.org it resolvers the external IP of the router correctly but then does not let me access the PI for witch I port forwarded correctly (on port 21 to the internal IP of the RPI)
Re: Hostname instead of IP
Well to be honest I though my router would resolve this since all is connected to it.PeterO wrote:How are you expecting the PC to resolve the hostname of the PI into its IP address ?
PeteO
yep I guess so too, even online port check tools say all the port are closed.This is probably a different issue anyway.
"This isnt where I parked my Car" - Albert Einstein - Zürich - 2008
Re: Hostname instead of IP
your pi make a DHCP request including its hostname.
but unfortunately, all routers does not link their embedded DNS server with the embedded DHCP server.
this is because for many routers, the DNS server is only a forwarder to your ISP DNS.
sometimes, the DHCP of the router directly send the ISP DNS in the DHCP offer/reply.
if you have a single computer, the simplest is to modify the hosts file of this computer, not on the Pi.
on windows, it's located at C:\Windows\system32\drivers\etc\hosts
add the hostname of your raspberry and its IP.
if you other computer is linux, it's simply /etc/hosts
this file as only a local meaning, and used by the local machine to override DNS solving.
if you have multiple computers :
* look if you can add static DHCP lease including a hostname in your router config
* or install a DNS server on your network, you will have to register it on your DHCP
* or buy another router or upgrade to OpenWRT
a last thing about arp -a
it only display last knows mac address. ARP table is often flushed. you have to ping that IP to have an entry in the ARP table.
but unfortunately, all routers does not link their embedded DNS server with the embedded DHCP server.
this is because for many routers, the DNS server is only a forwarder to your ISP DNS.
sometimes, the DHCP of the router directly send the ISP DNS in the DHCP offer/reply.
if you have a single computer, the simplest is to modify the hosts file of this computer, not on the Pi.
on windows, it's located at C:\Windows\system32\drivers\etc\hosts
add the hostname of your raspberry and its IP.
if you other computer is linux, it's simply /etc/hosts
this file as only a local meaning, and used by the local machine to override DNS solving.
if you have multiple computers :
* look if you can add static DHCP lease including a hostname in your router config
* or install a DNS server on your network, you will have to register it on your DHCP
* or buy another router or upgrade to OpenWRT
a last thing about arp -a
it only display last knows mac address. ARP table is often flushed. you have to ping that IP to have an entry in the ARP table.
WebIOPi - Raspberry Pi REST Framework to control your Pi from the web
http://store.raspberrypi.com/projects/webiopi
http://code.google.com/p/webiopi/
http://trouch.com
Re: Hostname instead of IP
A router will only do this if it is running a DNS server, in which case you'll need to use the routers gui to put entries into its DNS table.ATARI wrote:Well to be honest I though my router would resolve this since all is connected to it.PeterO wrote:How are you expecting the PC to resolve the hostname of the PI into its IP address ?
PeteO
yep I guess so too, even online port check tools say all the port are closed.This is probably a different issue anyway.
But probably the simplest way to get the PC to resolve the PI's address is to put the PI's hostname and ip address into the hosts file on the PC. I can't help you with that as I don't have any M$ windblows PCs here.
PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson
Re: Hostname instead of IP
haha allways with the love for microsoftPeterO wrote:
A router will only do this if it is running a DNS server, in which case you'll need to use the routers gui to put entries into its DNS table.
But probably the simplest way to get the PC to resolve the PI's address is to put the PI's hostname and ip address into the hosts file on the PC. I can't help you with that as I don't have any M$ windblows PCs here.
PeterO

well after a little fight with the PC over permissions i have change the "hosts" file and it now works wonderfull!
thanks alot
now I only have to open the proper ports on the router but I guess that this is for different forum right?
"This isnt where I parked my Car" - Albert Einstein - Zürich - 2008
Re: Hostname instead of IP
Most recent M$ software I have in my house is W95 on an old laptop !
PeterO
PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson
Re: Hostname instead of IP
so you stopped using Windows right about when I started using computersPeterO wrote:Most recent M$ software I have in my house is W95 on an old laptop !
PeterO

again thanks for the help. now I have to get this to work from externaly
"This isnt where I parked my Car" - Albert Einstein - Zürich - 2008
Re: Hostname instead of IP
Hi,
Rather than a new router you could try running dnsmasq on the pi and disable dhcp on the router,
http://www.thekelleys.org.uk/dnsmasq/doc.html, but more work but saves money.
Rather than a new router you could try running dnsmasq on the pi and disable dhcp on the router,
http://www.thekelleys.org.uk/dnsmasq/doc.html, but more work but saves money.