Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
MarlikAlmighty committed Dec 26, 2023
1 parent 0610364 commit b869122
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,19 @@ mDNS supports various types of DNS records, such as A, CNAME, MX, TXT, and other

## Usage

First, get the script and make it executable:
Open ports 53 in your firewall:
```sh
sudo ufw enable
sudo ufw allow 53/tcp
sudo ufw allow 53/udp
```

Don't forget 22 for SSH:
```sh
sudo ufw allow 22
```

Get the script and make it executable:
```sh
curl -O https://raw.githubusercontent.com/MarlikAlmighty/mdns/master/ubuntu-server-install.sh
chmod +x ubuntu-server-install.sh
Expand Down
14 changes: 2 additions & 12 deletions ubuntu-server-install.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

echo "Installing mDNS"
echo "Installing mdns server..."

if [ "$EUID" -ne 0 ]; then
echo "Sorry, you need to run this as root"
Expand Down Expand Up @@ -101,16 +101,6 @@ echo "error while restart systemd-resolved, exit."
exit 1
fi

ufw enable -y
ufw allow ssh
ufw allow 8081/tcp
ufw allow 53/tcp
ufw allow 53/udp
ERR=$?
if [[ $ERR != 0 ]]; then
echo "here is error: ufw allow 53 ports, do it manually"
fi

systemctl start mdns
ERR=$?
if [[ $ERR != 0 ]]; then
Expand All @@ -126,7 +116,7 @@ exit 1
fi

# add hostname to /etc/hosts
echo $(hostname -I | cut -d\ -f1) $(hostname) | sudo tee -a /etc/hosts > /dev/null
# echo $(hostname -I | cut -d\ -f1) $(hostname) | sudo tee -a /etc/hosts > /dev/null

echo "Done, mdns is installed."

Expand Down

0 comments on commit b869122

Please sign in to comment.