New Custom Script Request -- hostname

Discussion in 'Blackdroid' started by daevans315, Apr 8, 2010.

  1. daevans315

    daevans315 New Member

    Joined:
    Dec 30, 2009
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    IL
    Ratings:
    +0
    How about a custom script to update 'hostname'. I use dynamic DNS on several of the wireless networks I'm on and it would be nice to have a easy way to update the hostname the droid so it correctly passes a name to DHCP and then gets registered in DNS as a name I can use to get back to the droid.

    EDIT: Looks like this file is the key.
    /proc/sys/kernel/hostname

    I can edit it and it appears to change the name handed to my DHCP server.

     
    #1 daevans315, Apr 8, 2010
    Last edited: Apr 13, 2010
  2. MrSmith317

    MrSmith317 Moderator
    Premium Member

    Joined:
    Mar 26, 2010
    Messages:
    1,578
    Likes Received:
    31
    Trophy Points:
    78
    Location:
    Philadelphia
    Ratings:
    +31
    you should be able to edit /system/etc/dhcpcd/dhcpcd.conf and add a line like this:

    interface tiwlan0
    ddns-hostname mydroid_wifi
    option subnet_mask, routers, domain_name_servers

    The line ddns-hostname specifies the dns hostname that will be passed to the DNS server. I'm not sure if it works on Droid but it works in Linux..so why not?
     
  3. daevans315

    daevans315 New Member

    Joined:
    Dec 30, 2009
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    IL
    Ratings:
    +0
    I finally got some time to play with this, I don't think the driver understands the option.
    Adding it as shown and the wifi doesn't work at all. It doesn't even scan to find the available hotspots. If you put a ; at the end of the new line, you get the list of hotspots but it fails every time on getting the DHCP address. I never see it send a DHCP packet to my DHCP server. Its not a rights issue on the .conf file as I just put a # in front of the line and it works fine.
     
  4. MrSmith317

    MrSmith317 Moderator
    Premium Member

    Joined:
    Mar 26, 2010
    Messages:
    1,578
    Likes Received:
    31
    Trophy Points:
    78
    Location:
    Philadelphia
    Ratings:
    +31
    Ok, I'll play around with this more on my side and see if I can come up with something.
     
  5. MrSmith317

    MrSmith317 Moderator
    Premium Member

    Joined:
    Mar 26, 2010
    Messages:
    1,578
    Likes Received:
    31
    Trophy Points:
    78
    Location:
    Philadelphia
    Ratings:
    +31
    Ok, half a step closer. It looks like dhcpcd can be called with a -H option to set the hostname. Anyone know where dhcpcd is called from?
     
Search tags for this page
add a printer via hostname on android
,

script hostname android