Antsle Forum

Welcome to our Antsle community! This forum is to connect all Antsle users to post experiences, make user-generated content available for the entire community and more. 

Please note: This forum is about discussing one specific issue at a time. No generalizations. No judgments. Please check the Forum Rules before posting. If you have specific questions about your Antsle and expect a response from our team directly, please continue to use the appropriate channels (email: [email protected]) so every inquiry is tracked. 

Please or Register to create posts and topics.

Creating Custom .local DNS Entries For Your Antlets

Background:

Anstle provides a local DNS entry (mDNS) for each antlets (antlet10.local through antlet254.local).  This is done by using Avahi and Nginx.
During startup, the Antsle will begin broadcasting the antlet addresses via a python script. The Nginx configurations can be found in /etc/nginx/virtualhosts.  The antletxx.local config is defined in /etc/nginx/virtualhosts/antletnum.conf

Quickstart:

If you're not as interested in "how" it works, you can do the following:

  1. ssh into your antsle
  2. run "wget -O - https://raw.githubusercontent.com/lreading/antsle-scripts/master/custom_local_dns/setup.sh | bash"
  3. Edit /etc/nginx/virtualhosts/custom.dns.local.template to include the dns name you want and your antlet's IP address, and rename the file to <name>.local.custom.conf
  4. rc-service antlet_local_dns start && service nginx restart

Setup:

In order to prevent future antsle / antman updates from wiping out our changes, we are going to create our own scripts that will run on startup.  These scripts are available on GitHub, along with a setup script that automates this process.

  1. SSH into your antsle
  2. Copy antlet_local_dnsd to /usr/local/bin/antlet_local_dnsd and grant execute permissions (chmod +x /usr/local/bin/antlet_local_dnsd.py)
  3. Copy custom_local_dns.py to /usr/local/bin/custom_local_dns.py and grant execute permissions (chmod +x /usr/local/bin/custom_local_dns.py)
  4. Copy antlet_local_dns to /etc/init.d/antlet_local_dns and grant execute permissions (chmod +x /etc/init.d/antlet_local_dns)
  5. Run the following to have the service start on boot: `rc-update add /etc/init.d/antlet_local_dns default`
  6. Reboot the system OR start the service `rc-service antlet_local_dns start`
  7. Make a new Nginx config for your .local domain and put it in `/etc/nginx/virtualhosts`. BE SURE TO UPDATE THE PROPERTIES AND NAME IT WITH THE FOLLOWING CONVENTION: `<name>.local.custom.conf`
  8. Restart the antlet_local_dns service and the nginx service: `rc-service antlet_local_dns restart && service nginx restart`

Adding A New DNS Entry

To add a new DNS entry, you will need to create the config, then restart the antlet_local_dns service and the nginx service.  For an example nginx config, see the custom.dns.local.template.  This is a manual process.  If someone knows if there's any hooks into the antlet creation (that will not get blown away by updates) feel free to contribute. 🙂

  1. Create a new nginx config for your antlet in /etc/nginx/virtualhosts with the following naming convention: <name>.local.custom.conf
  2. Restart the antlet_local_dns service and the nginx service: `rc-service antlet_local_dns restart && service nginx restart`
tishihtzu has reacted to this post.
tishihtzu

This does not appear to work anymore. What has changed?

John S has reacted to this post.
John S

Will this method work for the Nano?

Quote from tishihtzu on April 9, 2020, 10:37 am

This does not appear to work anymore. What has changed?

There is more going on than just that.  When you upgrade to the current version of edgelinux you run into the issue where the host name spans all plugged in LAN connections.  This results in anthill updates stopping.  When you check the hosts file, there are only 2 entries within it.

127.0.0.1 hostname localhost

::1 hostname localhost

I am playing with a manual configuration change to see if I can work around the issue by binding it to an IP address.

tishihtzu has reacted to this post.
tishihtzu

Will this way of fixing the Nano work?

drift boss

 

Hi @riskrundown

The method above may have worked on Gentoo but now edgeLinux is using Systemd so will not work as described (including the nano).
Currently antsle_name.local works to reach antMan but the antletX.local does not work.

The antletX.local feature has been deprecated in favor of Port Forwarding and Bridged Networking methods of reaching antlets.

Please see information below for those methods:
https://docs.antsle.com/networking/port-forwarding
https://docs.antsle.com/networking/bridge

Thank you,
antsle Support