-
Notifications
You must be signed in to change notification settings - Fork 1
114 lines (100 loc) · 3.48 KB
/
dns-test-2.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: dns-test-2
on:
workflow_dispatch:
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ['macos-12', 'macos-latest', 'macos-13', 'macos-14']
try: ['0', '1', '2']
steps:
- run: system_profiler SPHardwareDataType
- name: hostname
run: |
echo -e "List the different names/addresses associsated with this host:\n\n"
echo "hostname : $(hostname $opt 2>/dev/null || echo '*error*')"
for opt in '-A' '-d' '-f'; do
echo "hostname $opt: $(hostname $opt 2>/dev/null || echo '*error*')"
done
- name: ipinfo
shell: bash
run: |
echo "====view dns info===="
scutil --dns
echo "resolv.conf"
sudo cat /etc/resolv.conf
echo "====view ip info===="
ifconfig
echo "====view hosts file===="
sudo cat /etc/hosts
- name: run host command 1
run: |
host localhost || true
host 127.0.0.1 || true
- name: nslookup1
shell: bash
run: |
echo -e "Expecting nslookup to return $(hostname -f)\n\n"
for host in "$(hostname)" "$(hostname -f)"; do
echo "nslookup $host: $(nslookup "$host" 2>&1 | grep -E '(Name:|\*\*)' || true)"
done
- name: dscacheutil1
shell: bash
run: |
echo "====dscacheutil hostname===="
dscacheutil -q host -a name $(hostname)
echo "====dscacheutil hostname -f===="
dscacheutil -q host -a name $(hostname -f)
echo "====dscacheutil hostname -s===="
dscacheutil -q host -a name $(hostname -s)
echo "====dscacheutil localhost===="
dscacheutil -q host -a name localhost
echo "====dscacheutil 127.0.0.1===="
dscacheutil -q host -a name 127.0.0.1
- name: ping1
shell: bash
continue-on-error: true
run: |
ping -c 1 $(hostname -f)
ping -c 1 $(hostname -s)
ping -c 1 localhost
ping -c 1 127.0.01
- name: test-workaround
shell: bash
run: |
#echo -e "$(ipconfig getifaddr en0) $(hostname -f) $(hostname -s)" | sudo tee -a /etc/hosts
sudo networksetup -setdnsservers Ethernet 9.9.9.9
- name: run host command 2
run: |
host localhost || true
host 127.0.0.1 || true
- name: nslookup2
shell: bash
run: |
echo -e "Expecting nslookup to return $(hostname -f)\n\n"
for host in "$(hostname)" "$(hostname -f)"; do
echo "nslookup $host: $(nslookup "$host" 2>&1 | grep -E '(Name:|\*\*)' || true)"
done
- name: dscacheutil2
shell: bash
run: |
echo "====dscacheutil hostname===="
dscacheutil -q host -a name $(hostname)
echo "====dscacheutil hostname -f===="
dscacheutil -q host -a name $(hostname -f)
echo "====dscacheutil hostname -s===="
dscacheutil -q host -a name $(hostname -s)
echo "====dscacheutil localhost===="
dscacheutil -q host -a name localhost
echo "====dscacheutil 127.0.0.1===="
dscacheutil -q host -a name 127.0.0.1
- name: ping2
shell: bash
continue-on-error: true
run: |
ping -c 1 $(hostname -f)
ping -c 1 $(hostname -s)
ping -c 1 localhost
ping -c 1 127.0.01